[NTOS]: Kill some debug spew.
[reactos.git] / reactos / ntoskrnl / mm / mmfault.c
index 02b3463..c4a8173 100644 (file)
@@ -274,15 +274,23 @@ MmAccessFault(IN BOOLEAN StoreInstruction,
 #endif
     }
     
-    //
-    // Check if this is an ARM3 memory area
-    //
+    /* 
+     * Check if this is an ARM3 memory area or if there's no memory area at all.
+     * The latter can happen early in the boot cycle when ARM3 paged pool is in
+     * use before having defined the memory areas proper.
+     * A proper fix would be to define memory areas in the ARM3 code, but we want
+     * to avoid adding this ReactOS-specific construct to ARM3 code.
+     * Either way, in the future, as ReactOS-paged pool is eliminated, this hack
+     * can go away.
+     */
     MemoryArea = MmLocateMemoryAreaByAddress(MmGetKernelAddressSpace(), Address);
-    if ((MemoryArea) && (MemoryArea->Type == MEMORY_AREA_OWNED_BY_ARM3))
+    if ((!(MemoryArea) && ((ULONG_PTR)Address >= (ULONG_PTR)MmPagedPoolStart)) ||
+        ((MemoryArea) && (MemoryArea->Type == MEMORY_AREA_OWNED_BY_ARM3)))
     {
         //
         // Hand it off to more competent hands...
         //
+        DPRINT("ARM3 fault %p\n", MemoryArea);
         return MmArmAccessFault(StoreInstruction, Address, Mode, TrapInformation);
     }   
 
@@ -305,7 +313,6 @@ MmCommitPagedPoolAddress(PVOID Address, BOOLEAN Locked)
 {
    NTSTATUS Status;
    PFN_TYPE AllocatedPage;
-   KIRQL OldIrql;
 
    Status = MmRequestPageMemoryConsumer(MC_PPOOL, FALSE, &AllocatedPage);
    if (!NT_SUCCESS(Status))
@@ -320,49 +327,5 @@ MmCommitPagedPoolAddress(PVOID Address, BOOLEAN Locked)
                              PAGE_READWRITE,
                              &AllocatedPage,
                              1);
-   if (Locked)
-   {
-      OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
-      MmLockPage(AllocatedPage);
-      KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
-   }
    return(Status);
 }
-
-/* PUBLIC FUNCTIONS ***********************************************************/
-
-/*
- * @implemented
- */
-BOOLEAN
-NTAPI
-MmIsAddressValid(IN PVOID VirtualAddress)
-{
-    MEMORY_AREA* MemoryArea;
-    PMMSUPPORT AddressSpace;
-    
-    DPRINT1("WARNING: %s returns bogus result\n", __FUNCTION__);
-    
-    if (VirtualAddress >= MmSystemRangeStart)
-    {
-        AddressSpace = MmGetKernelAddressSpace();
-    }
-    else
-    {
-        AddressSpace = &PsGetCurrentProcess()->Vm;
-    }
-    
-    MmLockAddressSpace(AddressSpace);
-    MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace,
-                                             VirtualAddress);
-    
-    if (MemoryArea == NULL || MemoryArea->DeleteInProgress)
-    {
-        MmUnlockAddressSpace(AddressSpace);
-        return(FALSE);
-    }
-    MmUnlockAddressSpace(AddressSpace);
-    return(TRUE);
-}
-
-/* EOF */