make.tmpl: add missing compiler attribute to build_progs
[AROS.git] / arch / all-unix / exec / shutdowna.c
blob41ea6b5b07bcc5a4a8457bc1acd6eabd9dafd524
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: ShutdownA() - Shut down the operating system.
6 Lang: english
7 */
9 /* Prevent 'timeval redefinition' error */
10 #define timeval timeval_AROS
12 #include <aros/debug.h>
13 #include <proto/exec.h>
15 #include "exec_intern.h"
16 #include "exec_util.h"
18 /* See rom/exec/shutdowna.c for documentation */
20 AROS_LH1(ULONG, ShutdownA,
21 AROS_LHA(ULONG, action, D0),
22 struct ExecBase *, SysBase, 173, Exec)
24 AROS_LIBFUNC_INIT
26 int exitcode;
28 switch(action)
30 case SD_ACTION_POWEROFF:
31 exitcode = 0;
32 break;
34 case SD_ACTION_COLDREBOOT:
35 exitcode = 0x81; /* Magic value for our bootstrap */
36 break;
38 default:
39 return 0; /* Unknown action code */
42 Exec_DoResetCallbacks((struct IntExecBase *)SysBase, action);
44 PD(SysBase).SysIFace->exit(exitcode);
45 AROS_HOST_BARRIER
47 /* Just shut up the compiler, we won't return */
48 return 0;
50 AROS_LIBFUNC_EXIT