revert between 56095 -> 55830 in arch
[AROS.git] / arch / m68k-amiga / exec / shutdowna.c
blobec08a772e801e29607c5da8264b6db84b75bda53
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 #include <aros/debug.h>
10 #include <proto/exec.h>
12 #include "exec_util.h"
14 /* See rom/exec/shutdowna.c for documentation */
16 AROS_LH1(ULONG, ShutdownA,
17 AROS_LHA(ULONG, action, D0),
18 struct ExecBase *, SysBase, 173, Exec)
20 AROS_LIBFUNC_INIT
22 switch (action) {
23 case SD_ACTION_POWEROFF:
25 /* No stock Amiga hardware is known to support this.
26 * Emulation will support it (unless high compatibility setting enabled). */
27 typedef ULONG (*UAELIBFUNC)(ULONG);
28 UAELIBFUNC uaelibfunc = NULL;
29 APTR uaeres;
31 uaeres = OpenResource("uae.resource");
32 if (uaeres) { /* new method that allows dynamic UAE ROM location */
33 uaelibfunc = AROS_LVO_CALL1(APTR,
34 AROS_LCA(UBYTE*, "uaelib_demux", A0),
35 APTR, uaeres, 1, );
37 if (uaelibfunc == NULL) {
38 /* old-style absolute address */
39 uaelibfunc = (UAELIBFUNC)(0x00F00000 + 0xFF60);
40 if ((((ULONG*)uaelibfunc)[0] & 0xff00ffff) != 0xa0004e75)
41 uaelibfunc = NULL;
43 if (uaelibfunc) {
44 uaelibfunc(13);
45 /* This may return. Quits when next vblank arrives */
46 for(;;)
49 break;
51 case SD_ACTION_COLDREBOOT:
52 ColdReboot();
53 break;
56 return -1;
58 AROS_LIBFUNC_EXIT