2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: ShutdownA() - Shut down the machine, PC version.
10 #include <proto/dos.h>
11 #include <proto/exec.h>
14 * This code performs machine reset via legacy PC keyboard controller hardware.
15 * On modern machines it's replaced by either efi.resource or acpi.resource,
16 * using SetFunction().
18 AROS_LH1(ULONG
, ShutdownA
,
19 AROS_LHA(ULONG
, action
, D0
),
20 struct ExecBase
*, SysBase
, 173, Exec
)
24 /* Nothing worked, poor-man fallback */
25 if (action
== SD_ACTION_COLDREBOOT
)
27 struct DosLibrary
*DOSBase
;
31 * Keyboard controller can be slow, so we need to wait for some time.
32 * If we don't do this, we'll can see "Unsupported action" error, immediately
33 * followed by a restart, which looks strange.
34 * we use dos.library/Delay() here for simplicity. It works from within tasks.
36 DOSBase
= (APTR
)OpenLibrary("dos.library", 36);
40 CloseLibrary((struct Library
*)DOSBase
);
43 * On some machines (new PCs without PS/2 keyboard and ACPI disabled)
44 * this might not work.
45 * So we need to be able to return cleanly.