[NTOS]: Kill some debug spew.
[reactos.git] / reactos / ntoskrnl / mm / mmfault.c
index 871d507..c4a8173 100644 (file)
@@ -231,7 +231,7 @@ MmNotPresentFault(KPROCESSOR_MODE Mode,
             break;
 
          case MEMORY_AREA_SHARED_DATA:
-              *MiAddressToPte((PVOID)USER_SHARED_DATA) = *MmSharedUserDataPte;
+              *MiAddressToPte(USER_SHARED_DATA) = *MmSharedUserDataPte;
               Status = STATUS_SUCCESS;
             break;
 
@@ -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);
     }   
 
@@ -304,8 +312,7 @@ NTAPI
 MmCommitPagedPoolAddress(PVOID Address, BOOLEAN Locked)
 {
    NTSTATUS Status;
-   PFN_NUMBER AllocatedPage;
-   KIRQL OldIrql;
+   PFN_TYPE AllocatedPage;
 
    Status = MmRequestPageMemoryConsumer(MC_PPOOL, FALSE, &AllocatedPage);
    if (!NT_SUCCESS(Status))
@@ -320,11 +327,5 @@ MmCommitPagedPoolAddress(PVOID Address, BOOLEAN Locked)
                              PAGE_READWRITE,
                              &AllocatedPage,
                              1);
-   if (Locked)
-   {
-      OldIrql = KeAcquireQueuedSpinLock(LockQueuePfnLock);
-      MmLockPage(AllocatedPage);
-      KeReleaseQueuedSpinLock(LockQueuePfnLock, OldIrql);
-   }
    return(Status);
 }