Revert "[NTOS:MM] Allow MiMapPageInHyperSpace to be called from DISPATCH_LEVEL"
authorJérôme Gardou <jerome.gardou@reactos.org>
Wed, 7 Apr 2021 21:26:44 +0000 (23:26 +0200)
committerJérôme Gardou <jerome.gardou@reactos.org>
Wed, 7 Apr 2021 21:26:44 +0000 (23:26 +0200)
This reverts commit 8404d1a6ff897f5210860ba52d70c3a6e86f3fbb.
Not ready for prime time, sorry.

ntoskrnl/include/internal/mm.h
ntoskrnl/mm/ARM3/hypermap.c

index 4718fca..074dbd4 100644 (file)
@@ -1011,26 +1011,17 @@ MmZeroPageThread(
 );
 
 /* hypermap.c *****************************************************************/
-_Acquires_lock_(Process->HyperSpaceLock)
-_When_(OldIrql == 0, _IRQL_requires_(DISPATCH_LEVEL))
-_When_(OldIrql != 0, _IRQL_requires_(PASSIVE_LEVEL))
-_When_(OldIrql != 0, _At_(*OldIrql, IRQL_saves_))
-_When_(OldIrql != 0, _IRQL_raises_(DISPATCH_LEVEL))
 PVOID
 NTAPI
-MiMapPageInHyperSpace(_In_ PEPROCESS Process,
-                      _In_ PFN_NUMBER Page,
-                      _Out_opt_ PKIRQL OldIrql);
+MiMapPageInHyperSpace(IN PEPROCESS Process,
+                      IN PFN_NUMBER Page,
+                      IN PKIRQL OldIrql);
 
-_Requires_lock_held_(Process->HyperSpaceLock)
-_Releases_lock_(Process->HyperSpaceLock)
-_IRQL_requires_(DISPATCH_LEVEL)
-_When_(OldIrql != MM_NOIRQL, _At_(OldIrql, _IRQL_restores_))
 VOID
 NTAPI
-MiUnmapPageInHyperSpace(_In_ PEPROCESS Process,
-                        _In_ PVOID Address,
-                        _In_ KIRQL OldIrql);
+MiUnmapPageInHyperSpace(IN PEPROCESS Process,
+                        IN PVOID Address,
+                        IN KIRQL OldIrql);
 
 PVOID
 NTAPI
index 88d1a1e..4113814 100644 (file)
@@ -23,24 +23,16 @@ MMPTE HyperTemplatePte;
 
 /* PRIVATE FUNCTIONS **********************************************************/
 
-_Acquires_lock_(Process->HyperSpaceLock)
-_When_(OldIrql == 0, _IRQL_requires_(DISPATCH_LEVEL))
-_When_(OldIrql != 0, _IRQL_requires_(PASSIVE_LEVEL))
-_When_(OldIrql != 0, _At_(*OldIrql, _IRQL_saves_))
-_When_(OldIrql != 0, _IRQL_raises_(DISPATCH_LEVEL))
 PVOID
 NTAPI
-MiMapPageInHyperSpace(_In_ PEPROCESS Process,
-                      _In_ PFN_NUMBER Page,
-                      _Out_opt_ PKIRQL OldIrql)
+MiMapPageInHyperSpace(IN PEPROCESS Process,
+                      IN PFN_NUMBER Page,
+                      IN PKIRQL OldIrql)
 {
     MMPTE TempPte;
     PMMPTE PointerPte;
     PFN_NUMBER Offset;
 
-    ASSERT(((OldIrql != NULL) && (KeGetCurrentIrql() == PASSIVE_LEVEL))
-        || ((OldIrql == NULL) && (KeGetCurrentIrql() == DISPATCH_LEVEL)));
-
     //
     // Never accept page 0 or non-physical pages
     //
@@ -62,10 +54,7 @@ MiMapPageInHyperSpace(_In_ PEPROCESS Process,
     // Acquire the hyperlock
     //
     ASSERT(Process == PsGetCurrentProcess());
-    if (OldIrql != NULL)
-        KeAcquireSpinLock(&Process->HyperSpaceLock, OldIrql);
-    else
-        KeAcquireSpinLockAtDpcLevel(&Process->HyperSpaceLock);
+    KeAcquireSpinLock(&Process->HyperSpaceLock, OldIrql);
 
     //
     // Now get the first free PTE
@@ -97,15 +86,11 @@ MiMapPageInHyperSpace(_In_ PEPROCESS Process,
     return MiPteToAddress(PointerPte);
 }
 
-_Requires_lock_held_(Process->HyperSpaceLock)
-_Releases_lock_(Process->HyperSpaceLock)
-_IRQL_requires_(DISPATCH_LEVEL)
-_When_(OldIrql != MM_NOIRQL, _At_(OldIrql, _IRQL_restores_))
 VOID
 NTAPI
-MiUnmapPageInHyperSpace(_In_ PEPROCESS Process,
-                        _In_ PVOID Address,
-                        _In_ KIRQL OldIrql)
+MiUnmapPageInHyperSpace(IN PEPROCESS Process,
+                        IN PVOID Address,
+                        IN KIRQL OldIrql)
 {
     ASSERT(Process == PsGetCurrentProcess());
 
@@ -118,10 +103,7 @@ MiUnmapPageInHyperSpace(_In_ PEPROCESS Process,
     // Release the hyperlock
     //
     ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
-    if (OldIrql == MM_NOIRQL)
-        KeReleaseSpinLockFromDpcLevel(&Process->HyperSpaceLock);
-    else
-        KeReleaseSpinLock(&Process->HyperSpaceLock, OldIrql);
+    KeReleaseSpinLock(&Process->HyperSpaceLock, OldIrql);
 }
 
 PVOID