Update capitalisation of AddDataTypes.
[AROS.git] / rom / efi / shutdowna.c
blob31981c256c2dc5639b7068cd123b2e42ec947856
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id: shutdowna.c 41386 2011-09-16 13:42:40Z sonic $
5 Desc: EFI replacement for exec.library/ShutdownA()
6 Lang: english
7 */
9 #include <aros/debug.h>
10 #include <exec/tasks.h>
11 #include <resources/efi.h>
12 #include <proto/exec.h>
14 #include "efi_intern.h"
16 AROS_LH1(ULONG, ShutdownA,
17 AROS_LHA(ULONG, action, D0),
18 struct ExecBase *, SysBase, 173, Efi)
20 AROS_LIBFUNC_INIT
22 struct EFIBase *EFIBase = OpenResource("efi.resource");
23 IPTR efiAction;
25 switch (action)
27 case SD_ACTION_COLDREBOOT:
28 efiAction = EFI_Reset_Cold;
29 break;
31 case SD_ACTION_POWEROFF:
32 efiAction = EFI_Reset_Shutdown;
33 break;
35 default:
36 /* Unknown action */
37 return 0;
40 /* Use EFI runtime services to perform the action */
41 EFIBase->Runtime->ResetSystem(efiAction, 0, 0, NULL);
43 /* Shut up the compiler, we should never reach this. */
44 return 0;
46 AROS_LIBFUNC_EXIT