revert between 56095 -> 55830 in arch
[AROS.git] / arch / all-pc / exec / powerstate_handlers.c
blob43af3539a61899f33c3217fc47119f8b0c18988d
1 /*
2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: default x86 power state handlers
6 Lang: english
7 */
9 #include <exec/interrupts.h>
10 #include <asm/io.h>
12 #include <proto/exec.h>
14 #define __AROS_KERNEL__
16 #include "exec_intern.h"
18 /* Call the kernel to perform a Cold Reset */
19 AROS_INTH1(Exec_X86ColdResetHandler, struct Interrupt *, handler)
21 AROS_INTFUNC_INIT
23 UBYTE action = handler->is_Node.ln_Type;
25 if (action == SD_ACTION_COLDREBOOT)
27 krnSysCallChangePMState(0xFF);
30 return FALSE;
32 AROS_INTFUNC_EXIT
35 /* Call the kernel to perform a Warm Reset */
36 AROS_INTH1(Exec_X86WarmResetHandler, struct Interrupt *, handler)
38 AROS_INTFUNC_INIT
40 UBYTE action = handler->is_Node.ln_Type;
42 if (action == SD_ACTION_WARMREBOOT)
44 /* Tell kernel to reboot */
45 __asm__ __volatile__ ("int $0xfe"::"a"(0x100));
48 /* We really should not return from that */
49 return FALSE;
51 AROS_INTFUNC_EXIT
54 /* This reset handler is called at the end of the shut down
55 * chain (after the power-off screen), and calls the kernel
56 * provided routine to power off the hardware if possible.
58 AROS_INTH1(Exec_X86ShutdownHandler, struct Interrupt *, handler)
60 AROS_INTFUNC_INIT
62 SuperState();
63 while (TRUE)
66 * Either we will forever loop looking for a
67 * syscall shutdown handler, or call an appropriate one =)
70 krnSysCallChangePMState(0);
73 /* We really should not return from that */
74 return FALSE;
76 AROS_INTFUNC_EXIT