1
0
mirror of https://github.com/deadw00d/AROS.git synced 2025-10-26 13:08:51 +00:00

Introduce EMERGENCY flag for ShutdownA

This flag indicates that something has already gone wrong and least
amount of code should be used to do reboot or shutdown. This means
not running non-critical reset handlers. Note that the handler itself
needs to decide whethere it is critical or not.
This commit is contained in:
deadwood
2022-01-16 10:28:06 +01:00
parent 749d2f6715
commit 1ebb5df920
7 changed files with 11 additions and 8 deletions

View File

@ -18,7 +18,7 @@ AROS_LH1(ULONG, ShutdownA,
while it's running. There's no sense in this beyond this point, so we simply Disable() */
Disable();
switch(action)
switch(action & SD_ACTION_MASK)
{
case SD_ACTION_POWEROFF:
PD(SysBase).ExitProcess(0);

View File

@ -18,7 +18,7 @@ AROS_INTH1(Exec_X86ColdResetHandler, struct Interrupt *, handler)
{
AROS_INTFUNC_INIT
UBYTE action = handler->is_Node.ln_Type;
UBYTE action = handler->is_Node.ln_Type & SD_ACTION_MASK;
if (action == SD_ACTION_COLDREBOOT)
{
@ -35,7 +35,7 @@ AROS_INTH1(Exec_X86WarmResetHandler, struct Interrupt *, handler)
{
AROS_INTFUNC_INIT
UBYTE action = handler->is_Node.ln_Type;
UBYTE action = handler->is_Node.ln_Type & SD_ACTION_MASK;
if (action == SD_ACTION_WARMREBOOT)
{

View File

@ -23,7 +23,7 @@ AROS_LH1(ULONG, ShutdownA,
int exitcode;
switch(action)
switch(action & SD_ACTION_MASK)
{
case SD_ACTION_POWEROFF:
exitcode = 0;

View File

@ -17,7 +17,7 @@ AROS_LH1(ULONG, ShutdownA,
{
AROS_LIBFUNC_INIT
switch (action) {
switch (action & SD_ACTION_MASK) {
case SD_ACTION_POWEROFF:
{
/* No stock Amiga hardware is known to support this.

View File

@ -34,9 +34,9 @@ AROS_LH1(ULONG, ShutdownA,
if (RTASBase)
{
if (action == SD_ACTION_COLDREBOOT)
if ((action & SD_ACTION_MASK) == SD_ACTION_COLDREBOOT)
rtas_call(SysBase, "system-reboot", 0, 1, NULL);
else if (action ==SD_ACTION_POWEROFF)
else if ((action & SD_ACTION_MASK) ==SD_ACTION_POWEROFF)
rtas_call(SysBase, "power-off", 2, 1, NULL, -1, -1);
}

View File

@ -234,4 +234,7 @@ struct ETask
#define SD_ACTION_COLDREBOOT 1
#define SD_ACTION_WARMREBOOT 2
#define SD_ACTION_MASK 0x00000007
#define SD_FLAG_EMERGENCY 0x00000008 /* Only the most basic/essential code should be executed */
#endif /* EXEC_TASKS_H */

View File

@ -26,7 +26,7 @@ AROS_INTH1(static ResetHandler, struct EFIBase *, EFIBase)
{
AROS_INTFUNC_INIT
UBYTE action = EFIBase->reset_handler.is_Node.ln_Type;
UBYTE action = EFIBase->reset_handler.is_Node.ln_Type & SD_ACTION_MASK;
IPTR efiAction;
switch (action)