-/* $Id$
- *
+/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/ex/power.c
/* INCLUDES *****************************************************************/
#include <ntoskrnl.h>
-#include <internal/debug.h>
+#include <debug.h>
/* FUNCTIONS *****************************************************************/
-/* ROS Internal. Please deprecate */
-NTHALAPI
-VOID
-NTAPI
-HalReleaseDisplayOwnership(
- VOID
-);
-
VOID STDCALL
KiHaltProcessorDpcRoutine(IN PKDPC Dpc,
IN PVOID DeferredContext,
IN PVOID SystemArgument1,
IN PVOID SystemArgument2)
{
+ KIRQL OldIrql;
if (DeferredContext)
{
ExFreePool(DeferredContext);
}
while (TRUE)
{
- KfRaiseIrql(SYNCH_LEVEL);
+ KeRaiseIrql(SYNCH_LEVEL, &OldIrql);
+#if defined(_M_X86)
Ke386HaltProcessor();
+#else
+ HalProcessorIdle();
+#endif
}
}
ShutdownThreadMain(PVOID Context)
{
SHUTDOWN_ACTION Action = (SHUTDOWN_ACTION)Context;
- LARGE_INTEGER Waittime;
static PCH FamousLastWords[] =
{
"Until then, there must be no regrets, no fears, no anxieties.\n"
"Just go forward in all your beliefs, and prove to me that I am not mistaken in\n"
"mine.\n",
- "Lowest possible energy state reached! Switch off now to achive a Bose-Einstein\n"
+ "Lowest possible energy state reached! Switch off now to achieve a Bose-Einstein\n"
"condensate.\n",
"Hasta la vista, BABY!\n",
"They live, we sleep!\n",
}
PspShutdownProcessManager();
- Waittime.QuadPart = (LONGLONG)-10000000; /* 1sec */
- KeDelayExecutionThread(KernelMode, FALSE, &Waittime);
- CmShutdownRegistry();
+ CmShutdownSystem();
+ MiShutdownMemoryManager();
IoShutdownRegisteredFileSystems();
IoShutdownRegisteredDevices();
- MiShutdownMemoryManager();
-
-
if (Action == ShutdownNoReboot)
{
HalDisplayString("\nYou can switch off your computer now\n");
PKDPC Dpc = ExAllocatePool(NonPagedPool, sizeof(KDPC));
if (Dpc == NULL)
{
- KEBUGCHECK(0);
+ ASSERT(FALSE);
}
KeInitializeDpc(Dpc, KiHaltProcessorDpcRoutine, (PVOID)Dpc);
KeSetTargetProcessorDpc(Dpc, i);
#endif /* CONFIG_SMP */
PopSetSystemPowerState(PowerSystemShutdown);
- CHECKPOINT1;
+ DPRINT1("Shutting down\n");
KiHaltProcessorDpcRoutine(NULL, NULL, NULL, NULL);
/* KiHaltProcessor does never return */
(PVOID)Action);
if (!NT_SUCCESS(Status))
{
- KEBUGCHECK(0);
+ ASSERT(FALSE);
}
Status = ObReferenceObjectByHandle(ThreadHandle,
THREAD_ALL_ACCESS,
NtClose(ThreadHandle);
if (!NT_SUCCESS(Status))
{
- KEBUGCHECK(0);
+ ASSERT(FALSE);
}
KeSetPriorityThread(&ShutdownThread->Tcb, LOW_REALTIME_PRIORITY + 1);