Test initialisation of MUIA_List_AdjustWidth and MUIA_List_AdjustHeight, and
[AROS.git] / arch / all-pc / exec / reset_init.c
blob43459d78588d859f17034c9d4f3c530988879304
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Install default reset handlers
6 Lang: english
7 */
9 #include <exec/interrupts.h>
10 #include <aros/symbolsets.h>
11 #include <asm/io.h>
13 #include <proto/exec.h>
15 #include "exec_intern.h"
17 /* This reset handler is called if more modern system reset mechanisms fail
18 * or are not available */
19 AROS_INTH1(static ColdResetHandler, struct Interrupt *, handler)
21 AROS_INTFUNC_INIT
23 UBYTE action = handler->is_Node.ln_Type;
25 if (action == SD_ACTION_COLDREBOOT)
27 outb(0xFE, 0x64);
30 * On some machines (new PCs without a PS/2 controller), this might
31 * not work. So we need to be able to return cleanly.
35 return FALSE;
37 AROS_INTFUNC_EXIT
40 /* This reset handler is called for ColdReboot() */
41 AROS_INTH1(static WarmResetHandler, struct Interrupt *, handler)
43 AROS_INTFUNC_INIT
45 UBYTE action = handler->is_Node.ln_Type;
47 if (action == SD_ACTION_WARMREBOOT)
49 /* Tell kernel to reboot */
50 __asm__ __volatile__ ("int $0x80"::"a"(0x100));
53 /* We really should not return from that */
54 return FALSE;
56 AROS_INTFUNC_EXIT
59 /* This reset handler is called if software power-off or reboot has not
60 * occurred. It is called after the shutdown screen is shown so that the
61 * system isn't still alive in the background */
62 AROS_INTH1(static ShutdownHandler, struct Interrupt *, handler)
64 AROS_INTFUNC_INIT
66 SuperState();
67 while (TRUE) asm volatile("hlt");
69 /* We really should not return from that */
70 return FALSE;
72 AROS_INTFUNC_EXIT
75 /* Install handlers */
76 int Exec_ResetInit(struct IntExecBase *SysBase)
78 SysBase->ColdResetHandler.is_Node.ln_Pri = -64;
79 SysBase->ColdResetHandler.is_Node.ln_Name = "keyboard controller reset";
80 SysBase->ColdResetHandler.is_Code = (VOID_FUNC)ColdResetHandler;
81 SysBase->ColdResetHandler.is_Data = &SysBase->ColdResetHandler;
82 AddResetCallback(&SysBase->ColdResetHandler);
84 SysBase->WarmResetHandler.is_Node.ln_Pri = -64;
85 SysBase->WarmResetHandler.is_Node.ln_Name = "kernel reset";
86 SysBase->WarmResetHandler.is_Code = (VOID_FUNC)WarmResetHandler;
87 SysBase->WarmResetHandler.is_Data = &SysBase->WarmResetHandler;
88 AddResetCallback(&SysBase->WarmResetHandler);
90 SysBase->ShutdownHandler.is_Node.ln_Pri = -128;
91 SysBase->ShutdownHandler.is_Node.ln_Name = "HLT shutdown";
92 SysBase->ShutdownHandler.is_Code = (VOID_FUNC)ShutdownHandler;
93 SysBase->ShutdownHandler.is_Data = &SysBase->ShutdownHandler;
94 AddResetCallback(&SysBase->ShutdownHandler);
96 return 1;
99 ADD2INITLIB(Exec_ResetInit, 0)