Author: tkreuzer
Date: Fri Aug 1 17:18:58 2008
New Revision: 35021
URL:
http://svn.reactos.org/svn/reactos?rev=35021&view=rev
Log:
use constants from winddk and get rid of private definitions.
Modified:
branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/loader.c
branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/loader.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
==============================================================================
--- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/loader.c
[iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/arch/amd64/loader.c
[iso-8859-1] Fri Aug 1 17:18:58 2008
@@ -134,14 +134,14 @@
PPAGE_DIRECTORY_AMD64 pDir3, pDir2, pDir1;
ULONG Index;
- pDir3 = FrLdrGetOrCreatePageDir(pPML4, VAtoIndex4(VirtualAddress));
- pDir2 = FrLdrGetOrCreatePageDir(pDir3, VAtoIndex3(VirtualAddress));
- pDir1 = FrLdrGetOrCreatePageDir(pDir2, VAtoIndex2(VirtualAddress));
+ pDir3 = FrLdrGetOrCreatePageDir(pPML4, VAtoPXI(VirtualAddress));
+ pDir2 = FrLdrGetOrCreatePageDir(pDir3, VAtoPPI(VirtualAddress));
+ pDir1 = FrLdrGetOrCreatePageDir(pDir2, VAtoPDI(VirtualAddress));
if (!pDir1)
return FALSE;
- Index = VAtoIndex1(VirtualAddress);
+ Index = VAtoPTI(VirtualAddress);
if (pDir1->Pde[Index].Valid)
{
return FALSE;
@@ -203,14 +203,9 @@
/* The page tables are located at 0xfffff68000000000
* We create a recursive self mapping through all 4 levels at
* virtual address 0xfffff6fb7dbedf68 */
- pPML4->Pde[VAtoIndex4(PML4_BASE)].Valid = 1;
- pPML4->Pde[VAtoIndex4(PML4_BASE)].Write = 1;
- pPML4->Pde[VAtoIndex4(PML4_BASE)].PageFrameNumber = PtrToPfn(PML4_BASE);
-
- ASSERT(VAtoIndex4(PML4_BASE) == 0x1ed);
- ASSERT(VAtoIndex3(PML4_BASE) == 0x1ed);
- ASSERT(VAtoIndex2(PML4_BASE) == 0x1ed);
- ASSERT(VAtoIndex1(PML4_BASE) == 0x1ed);
+ pPML4->Pde[VAtoPXI(PXE_BASE)].Valid = 1;
+ pPML4->Pde[VAtoPXI(PXE_BASE)].Write = 1;
+ pPML4->Pde[VAtoPXI(PXE_BASE)].PageFrameNumber = PtrToPfn(PXE_BASE);
/* Setup low memory pages */
if (FrLdrMapRangeOfPages(0, 0, 1024) < 1024)
Modified:
branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/…
==============================================================================
--- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h
[iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h
[iso-8859-1] Fri Aug 1 17:18:58 2008
@@ -28,21 +28,15 @@
#define LMODE_DS 0x10
#define VA_MASK 0x0000FFFFFFFFFFFFUL
-#define PML4_SHIFT (12+9+9+9)
-#define PDP_SHIFT (12+9+9)
-#define PD_SHIFT (12+9)
-#define PT_SHIFT 12
#define PtrToPfn(p) \
- ((((ULONGLONG)p) >> PT_SHIFT) & 0xffffffffffULL)
+ ((((ULONGLONG)p) >> PAGE_SHIFT) & 0xffffffffffULL)
-#define VAtoIndex4(va) (((va) >> PML4_SHIFT) & 0x1FF)
-#define VAtoIndex3(va) (((va) >> PDP_SHIFT) & 0x1FF)
-#define VAtoIndex2(va) (((va) >> PD_SHIFT) & 0x1FF)
-#define VAtoIndex1(va) (((va) >> PT_SHIFT) & 0x1FF)
+#define VAtoPXI(va) (((va) >> PXI_SHIFT) & 0x1FF)
+#define VAtoPPI(va) (((va) >> PPI_SHIFT) & 0x1FF)
+#define VAtoPDI(va) (((va) >> PDI_SHIFT) & 0x1FF)
+#define VAtoPTI(va) (((va) >> PTI_SHIFT) & 0x1FF)
-#define PAGETABLE_BASE 0xfffff68000000000ULL
-#define PML4_BASE 0xfffff6fb7dbedf68ULL
#define HYPERSPACE_BASE 0xfffff70000000000ULL
#define HAL_BASE 0xffffffff80000000ULL
#define APIC_BASE 0xffffffffff000000ULL // FIXME