From 7cd2e3f4984663eb53fc92c889218ffc060b95c5 Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Wed, 29 Nov 2006 07:32:27 +0000 Subject: [PATCH] - There's no such thing as Phase 2 HAL init. - Only map the 0x0 physical address in HalpReboot when enabling warm-reboot, there's no need to map it during init and keep it allocated during the whole time. svn path=/trunk/; revision=24962 --- reactos/hal/halx86/generic/halinit.c | 6 ------ reactos/hal/halx86/generic/reboot.c | 6 ++++-- reactos/ntoskrnl/ex/init.c | 1 - 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/reactos/hal/halx86/generic/halinit.c b/reactos/hal/halx86/generic/halinit.c index e4e1d978eed..40c3fe29b3b 100644 --- a/reactos/hal/halx86/generic/halinit.c +++ b/reactos/hal/halx86/generic/halinit.c @@ -14,7 +14,6 @@ /* GLOBALS *******************************************************************/ -PVOID HalpZeroPageMapping = NULL; HALP_HOOKS HalpHooks; BOOLEAN HalpPciLockSettings; @@ -50,7 +49,6 @@ NTAPI HalInitSystem(IN ULONG BootPhase, IN PLOADER_PARAMETER_BLOCK LoaderBlock) { - PHYSICAL_ADDRESS Null = {{0}}; PKPRCB Prcb = KeGetCurrentPrcb(); /* Check the boot phase */ @@ -118,10 +116,6 @@ HalInitSystem(IN ULONG BootPhase, /* Initialize DMA. NT does this in Phase 0 */ HalpInitDma(); } - else if (BootPhase == 2) - { - HalpZeroPageMapping = MmMapIoSpace(Null, PAGE_SIZE, MmNonCached); - } /* All done, return */ return TRUE; diff --git a/reactos/hal/halx86/generic/reboot.c b/reactos/hal/halx86/generic/reboot.c index dbfef6873e4..69e90151ed5 100644 --- a/reactos/hal/halx86/generic/reboot.c +++ b/reactos/hal/halx86/generic/reboot.c @@ -28,10 +28,12 @@ NTAPI HalpReboot(VOID) { UCHAR Data; - extern PVOID HalpZeroPageMapping; + PVOID HalpZeroPageMapping; + PHYSICAL_ADDRESS Null = {{0}}; /* Enable warm reboot */ - ((PUSHORT)HalpZeroPageMapping)[0x472] = 0x1234; + HalpZeroPageMapping = MmMapIoSpace(Null, PAGE_SIZE, MmNonCached); + ((PUSHORT)HalpZeroPageMapping)[0x239] = 0x1234; /* FIXME: Lock CMOS Access */ diff --git a/reactos/ntoskrnl/ex/init.c b/reactos/ntoskrnl/ex/init.c index b3fb23d0c96..df31d1c5d95 100644 --- a/reactos/ntoskrnl/ex/init.c +++ b/reactos/ntoskrnl/ex/init.c @@ -840,7 +840,6 @@ ExPhase2Init(PVOID Context) if (!NoGuiBoot) InbvDisplayBootLogo(); /* Clear the screen to blue and display the boot notice and debug status */ - HalInitSystem(2, KeLoaderBlock); if (NoGuiBoot) ExpDisplayNotice(); KdInitSystem(2, KeLoaderBlock);