https://git.reactos.org/?p=reactos.git;a=commitdiff;h=03a9ccce651b2803f5866…
commit 03a9ccce651b2803f5866ba3b8b2a4746a9c5ccf
Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
AuthorDate: Sun Nov 24 22:56:55 2019 +0100
Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org>
CommitDate: Mon Nov 25 00:41:54 2019 +0100
[NTOS:KE] Explicitly use IOPM_SIZE for initializing the IO map, that is indeed also
equal to PAGE_SIZE * 2 but is self-documented.
---
ntoskrnl/ke/amd64/kiinit.c | 6 +++---
ntoskrnl/ke/i386/kiinit.c | 4 ++--
ntoskrnl/ke/i386/v86vdm.c | 6 +++---
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/ntoskrnl/ke/amd64/kiinit.c b/ntoskrnl/ke/amd64/kiinit.c
index adeac8fdf5a..74623c1a2ca 100644
--- a/ntoskrnl/ke/amd64/kiinit.c
+++ b/ntoskrnl/ke/amd64/kiinit.c
@@ -75,12 +75,12 @@ KiInitMachineDependent(VOID)
// /* Allocate the IOPM save area */
// Ki386IopmSaveArea = ExAllocatePoolWithTag(PagedPool,
-// PAGE_SIZE * 2,
-// TAG('K', 'e', '
', ' '));
+// IOPM_SIZE,
+// ' eK');
// if (!Ki386IopmSaveArea)
// {
// /* Bugcheck. We need this for V86/VDM support. */
-// KeBugCheckEx(NO_PAGES_AVAILABLE, 2, PAGE_SIZE * 2, 0, 0);
+// KeBugCheckEx(NO_PAGES_AVAILABLE, 2, IOPM_SIZE, 0, 0);
// }
}
diff --git a/ntoskrnl/ke/i386/kiinit.c b/ntoskrnl/ke/i386/kiinit.c
index 230ee5235fb..7fc38067730 100644
--- a/ntoskrnl/ke/i386/kiinit.c
+++ b/ntoskrnl/ke/i386/kiinit.c
@@ -590,12 +590,12 @@ KiInitializeKernel(IN PKPROCESS InitProcess,
/* Allocate the IOPM save area */
Ki386IopmSaveArea = ExAllocatePoolWithTag(PagedPool,
- PAGE_SIZE * 2,
+ IOPM_SIZE,
' eK');
if (!Ki386IopmSaveArea)
{
/* Bugcheck. We need this for V86/VDM support. */
- KeBugCheckEx(NO_PAGES_AVAILABLE, 2, PAGE_SIZE * 2, 0, 0);
+ KeBugCheckEx(NO_PAGES_AVAILABLE, 2, IOPM_SIZE, 0, 0);
}
}
diff --git a/ntoskrnl/ke/i386/v86vdm.c b/ntoskrnl/ke/i386/v86vdm.c
index d1c030acc0c..e629f8bb44e 100644
--- a/ntoskrnl/ke/i386/v86vdm.c
+++ b/ntoskrnl/ke/i386/v86vdm.c
@@ -668,8 +668,8 @@ Ke386CallBios(IN ULONG Int,
/* Make sure there's space for two IOPMs, then copy & clear the current */
ASSERT(((PKIPCR)KeGetPcr())->GDT[KGDT_TSS / 8].LimitLow >=
(0x2000 + IOPM_OFFSET - 1));
- RtlCopyMemory(Ki386IopmSaveArea, &Tss->IoMaps[0].IoMap, PAGE_SIZE * 2);
- RtlZeroMemory(&Tss->IoMaps[0].IoMap, PAGE_SIZE * 2);
+ RtlCopyMemory(Ki386IopmSaveArea, &Tss->IoMaps[0].IoMap, IOPM_SIZE);
+ RtlZeroMemory(&Tss->IoMaps[0].IoMap, IOPM_SIZE);
/* Save the old offset and base, and set the new ones */
OldOffset = Process->IopmOffset;
@@ -681,7 +681,7 @@ Ke386CallBios(IN ULONG Int,
Ki386SetupAndExitToV86Mode(VdmTeb);
/* Restore IOPM */
- RtlCopyMemory(&Tss->IoMaps[0].IoMap, Ki386IopmSaveArea, PAGE_SIZE * 2);
+ RtlCopyMemory(&Tss->IoMaps[0].IoMap, Ki386IopmSaveArea, IOPM_SIZE);
Process->IopmOffset = OldOffset;
Tss->IoMapBase = OldBase;