2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: ntoskrnl/ex/power.c
5 * PURPOSE: Power managment
6 * PROGRAMMER: David Welch (welch@cwcom.net)
9 * Added reboot support 30/01/99
12 /* INCLUDES *****************************************************************/
14 #include <ddk/ntddk.h>
16 #include <internal/ps.h>
17 #include <internal/io.h>
18 #include <internal/mm.h>
19 #include <internal/po.h>
21 #include <internal/debug.h>
23 /* FUNCTIONS *****************************************************************/
26 NtSetSystemPowerState(IN POWER_ACTION SystemAction
,
27 IN SYSTEM_POWER_STATE MinSystemState
,
30 /* Windows 2000 only */
31 return(STATUS_UNIMPLEMENTED
);
35 NtShutdownSystem(IN SHUTDOWN_ACTION Action
)
37 if (Action
> ShutdownPowerOff
)
38 return STATUS_INVALID_PARAMETER
;
40 IoShutdownRegisteredDevices();
42 IoShutdownRegisteredFileSystems();
43 PiShutdownProcessManager();
44 MiShutdownMemoryManager();
46 if (Action
== ShutdownNoReboot
)
50 HalReturnToFirmware (FIRMWARE_OFF
);
52 PopSetSystemPowerState(PowerSystemShutdown
);
55 else if (Action
== ShutdownReboot
)
57 HalReturnToFirmware (FIRMWARE_REBOOT
);
61 HalReturnToFirmware (FIRMWARE_HALT
);
64 return STATUS_SUCCESS
;