[NTOSKRNL/FREELDR/NDK]
[reactos.git] / reactos / ntoskrnl / mm / arm / stubs.c
index 2d43dfc..e1031fe 100644 (file)
@@ -97,7 +97,7 @@ MiGetPageTableForProcess(IN PEPROCESS Process,
     //
     // Get the PDE
     //
-    PointerPde = MiGetPdeAddress(Address);
+    PointerPde = MiAddressToPde(Address);
     if (PointerPde->u.Hard.Coarse.Valid)
     {
         //
@@ -141,7 +141,7 @@ MiGetPageTableForProcess(IN PEPROCESS Process,
                 // Save it
                 //
                 //MmGlobalKernelPageDirectory[PdeOffset] = TempPde.u.Hard.AsUlong;
-                //DPRINT1("KPD: %p PDEADDR: %p\n", &MmGlobalKernelPageDirectory[PdeOffset], MiGetPdeAddress(Address));
+                //DPRINT1("KPD: %p PDEADDR: %p\n", &MmGlobalKernelPageDirectory[PdeOffset], MiAddressToPde(Address));
 
                 //
                 // FIXFIX: Double check with Felix tomorrow
@@ -150,7 +150,7 @@ MiGetPageTableForProcess(IN PEPROCESS Process,
                 //
                 // Get the PTE for this 1MB region
                 //
-                PointerPte = MiGetPteAddress(MiGetPteAddress(Address));
+                PointerPte = MiAddressToPte(MiAddressToPte(Address));
                 DPRINT1("PointerPte: %p\n", PointerPte);
 
                 //
@@ -206,7 +206,7 @@ MiGetPageTableForProcess(IN PEPROCESS Process,
     //
     // Return the PTE
     //
-    return MiGetPteAddress(Address);
+    return MiAddressToPte(Address);
 }
 
 MMPTE
@@ -237,58 +237,6 @@ MiGetPageEntryForProcess(IN PEPROCESS Process,
     return Pte;
 }
 
-VOID
-NTAPI
-MmDeletePageTable(IN PEPROCESS Process,
-                  IN PVOID Address)
-{
-    PMMPDE_HARDWARE PointerPde;
-
-    //
-    // Not valid for kernel addresses
-    //
-    DPRINT("MmDeletePageTable(%p, %p)\n", Process, Address);
-    ASSERT(Address < MmSystemRangeStart);
-
-    //
-    // Check if this is for a different process
-    //
-    if ((Process) && (Process != PsGetCurrentProcess()))
-    {
-        //
-        // FIXME-USER: Need to attach to the process
-        //
-        ASSERT(FALSE);
-    }
-
-    //
-    // Get the PDE
-    //
-    PointerPde = MiGetPdeAddress(Address);
-
-    //
-    // On ARM, we use a section mapping for the original low-memory mapping
-    //
-    if ((Address) || (PointerPde->u.Hard.Section.Valid == 0))
-    {
-        //
-        // Make sure it's valid
-        //
-        ASSERT(PointerPde->u.Hard.Coarse.Valid == 1);
-    }
-
-    //
-    // Clear the PDE
-    //
-    PointerPde->u.Hard.AsUlong = 0;
-    ASSERT(PointerPde->u.Hard.Coarse.Valid == 0);
-
-    //
-    // Invalidate the TLB entry
-    //
-    MiFlushTlb((PMMPTE)PointerPde, MiGetPteAddress(Address));
-}
-
 BOOLEAN
 NTAPI
 MmCreateProcessAddressSpace(IN ULONG MinWs,
@@ -367,38 +315,6 @@ MmCreateProcessAddressSpace(IN ULONG MinWs,
     return TRUE;
 }
 
-NTSTATUS
-NTAPI
-Mmi386ReleaseMmInfo(IN PEPROCESS Process)
-{
-    //
-    // FIXME-USER: Need to delete address space
-    //
-    UNIMPLEMENTED_DBGBREAK();
-    return STATUS_NOT_IMPLEMENTED;
-}
-
-PULONG
-NTAPI
-MmGetPageDirectory(VOID)
-{
-    //
-    // Return the TTB
-    //
-    return (PULONG)KeArmTranslationTableRegisterGet().AsUlong;
-}
-
-VOID
-NTAPI
-MmEnableVirtualMapping(IN PEPROCESS Process,
-                       IN PVOID Address)
-{
-    //
-    // TODO
-    //
-    UNIMPLEMENTED_DBGBREAK();
-}
-
 NTSTATUS
 NTAPI
 MmCreateVirtualMappingInternal(IN PEPROCESS Process,
@@ -482,24 +398,6 @@ MmCreateVirtualMappingInternal(IN PEPROCESS Process,
     return STATUS_SUCCESS;
 }
 
-NTSTATUS
-NTAPI
-MmCreateVirtualMappingForKernel(IN PVOID Address,
-                                IN ULONG Protection,
-                                IN PPFN_NUMBER Pages,
-                                IN ULONG PageCount)
-{
-    //
-    // Call the internal version
-    //
-    return MmCreateVirtualMappingInternal(NULL,
-                                          Address,
-                                          Protection,
-                                          Pages,
-                                          PageCount,
-                                          FALSE);
-}
-
 NTSTATUS
 NTAPI
 MmCreateVirtualMappingUnsafe(IN PEPROCESS Process,
@@ -566,7 +464,6 @@ VOID
 NTAPI
 MmDeleteVirtualMapping(IN PEPROCESS Process,
                        IN PVOID Address,
-                       IN BOOLEAN FreePage,
                        OUT PBOOLEAN WasDirty,
                        OUT PPFN_NUMBER Page)
 {
@@ -750,8 +647,8 @@ MmInitGlobalKernelPageDirectory(VOID)
     // Good place to setup template PTE/PDEs.
     // We are lazy and pick a known-good PTE
     //
-    MiArmTemplatePte = *MiGetPteAddress(0x80000000);
-    MiArmTemplatePde = *MiGetPdeAddress(0x80000000);
+    MiArmTemplatePte = *MiAddressToPte(0x80000000);
+    MiArmTemplatePde = *MiAddressToPde(0x80000000);
 
     //
     // Loop the 2GB of address space which belong to the kernel
@@ -774,59 +671,6 @@ MmInitGlobalKernelPageDirectory(VOID)
     }
 }
 
-VOID
-NTAPI
-MiInitPageDirectoryMap(VOID)
-{
-    MEMORY_AREA* MemoryArea = NULL;
-    PVOID BaseAddress;
-    NTSTATUS Status;
-
-    //
-    // Create memory area for the PTE area
-    //
-    BaseAddress = (PVOID)PTE_BASE;
-    Status = MmCreateMemoryArea(MmGetKernelAddressSpace(),
-                                MEMORY_AREA_OWNED_BY_ARM3,
-                                &BaseAddress,
-                                0x1000000,
-                                PAGE_READWRITE,
-                                &MemoryArea,
-                                TRUE,
-                                0,
-                                PAGE_SIZE);
-    ASSERT(NT_SUCCESS(Status));
-
-    //
-    // Create memory area for the PDE area
-    //
-    BaseAddress = (PVOID)PDE_BASE;
-    Status = MmCreateMemoryArea(MmGetKernelAddressSpace(),
-                                MEMORY_AREA_OWNED_BY_ARM3,
-                                &BaseAddress,
-                                0x100000,
-                                PAGE_READWRITE,
-                                &MemoryArea,
-                                TRUE,
-                                0,
-                                PAGE_SIZE);
-    ASSERT(NT_SUCCESS(Status));
-
-    //
-    // And finally, hyperspace
-    //
-    BaseAddress = (PVOID)HYPER_SPACE;
-    Status = MmCreateMemoryArea(MmGetKernelAddressSpace(),
-                                MEMORY_AREA_OWNED_BY_ARM3,
-                                &BaseAddress,
-                                PAGE_SIZE,
-                                PAGE_READWRITE,
-                                &MemoryArea,
-                                TRUE,
-                                0,
-                                PAGE_SIZE);
-    ASSERT(NT_SUCCESS(Status));
-}
 
 /* PUBLIC FUNCTIONS ***********************************************************/
 
@@ -849,7 +693,7 @@ MmGetPhysicalAddress(IN PVOID Address)
         // ARM Hack while we still use a section PTE
         //
         PMMPDE_HARDWARE PointerPde;
-        PointerPde = MiGetPdeAddress(PCR);
+        PointerPde = MiAddressToPde(PCR);
         ASSERT(PointerPde->u.Hard.Section.Valid == 1);
         PhysicalAddress.QuadPart = PointerPde->u.Hard.Section.PageFrameNumber;
         PhysicalAddress.QuadPart <<= CPT_SHIFT;