6def8dc515351fa0f291480ba0e5b421e9af1349
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
5 Desc: ShutdownA() - Shut down the operating system.
9 /* Prevent 'timeval redefinition' error */
10 #define _AROS_TYPES_TIMEVAL_S_H_
12 #include <aros/debug.h>
13 #include <proto/exec.h>
15 #include "exec_intern.h"
16 #include "exec_util.h"
18 /*****************************************************************************
22 AROS_LH1(ULONG
, ShutdownA
,
25 AROS_LHA(ULONG
, action
, D0
),
28 struct ExecBase
*, SysBase
, 173, Exec
)
31 This function will shut down the operating system.
35 * SD_ACTION_POWEROFF - power off the machine.
36 * SD_ACTION_COLDREBOOT - cold reboot the machine (not only AROS).
39 This function does not return in case of success. Otherwise is returns
43 It can be quite harmful to call this function. It may be possible that
44 you will lose data from other tasks not having saved, or disk buffers
45 not being flushed. Plus you could annoy the (other) users.
54 ******************************************************************************/
62 case SD_ACTION_POWEROFF
:
66 case SD_ACTION_COLDREBOOT
:
67 exitcode
= 0x81; /* Magic value for our bootstrap */
71 return 0; /* Unknown action code */
74 Exec_DoResetCallbacks((struct IntExecBase
*)SysBase
, action
);
76 PD(SysBase
).SysIFace
->exit(exitcode
);
79 /* Just shut up the compiler, we won't return */