Author: sir_richard
Date: Mon Oct 18 14:34:35 2010
New Revision: 49196
URL:
http://svn.reactos.org/svn/reactos?rev=49196&view=rev
Log:
[NTOS]: Remove the "35314 sginsberg /* REACTOS Mm Hack of Doom */".
Apocalypse averted?
Modified:
trunk/reactos/ntoskrnl/include/internal/mm.h
trunk/reactos/ntoskrnl/ke/i386/ctxswitch.S
trunk/reactos/ntoskrnl/ke/procobj.c
trunk/reactos/ntoskrnl/ke/thrdobj.c
trunk/reactos/ntoskrnl/ke/thrdschd.c
trunk/reactos/ntoskrnl/mm/i386/page.c
trunk/reactos/ntoskrnl/mm/mmfault.c
Modified: trunk/reactos/ntoskrnl/include/internal/mm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/include/internal/mm.h [iso-8859-1] Mon Oct 18 14:34:35 2010
@@ -1670,20 +1670,6 @@
IN PLIST_ENTRY ListHead
);
-/* ReactOS Mm Hacks */
-VOID
-FASTCALL
-MiSyncForProcessAttach(
- IN PKTHREAD NextThread,
- IN PEPROCESS Process
-);
-
-VOID
-FASTCALL
-MiSyncForContextSwitch(
- IN PKTHREAD Thread
-);
-
extern PMMSUPPORT MmKernelAddressSpace;
FORCEINLINE
Modified: trunk/reactos/ntoskrnl/ke/i386/ctxswitch.S
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/ctxswitch…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/ctxswitch.S [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/ctxswitch.S [iso-8859-1] Mon Oct 18 14:34:35 2010
@@ -584,10 +584,6 @@
#endif
SwapContext:
- /* ReactOS Mm Hack */
- mov ecx, esi
- call @MiSyncForContextSwitch@4
-
/* Swap context at APC_LEVEL */
mov ecx, APC_LEVEL
call @KiSwapContextInternal@0
Modified: trunk/reactos/ntoskrnl/ke/procobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/procobj.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/procobj.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/procobj.c [iso-8859-1] Mon Oct 18 14:34:35 2010
@@ -96,9 +96,6 @@
/* Release lock */
KiReleaseApcLockFromDpcLevel(ApcLock);
-
- /* Make sure that we are in the right page directory (ReactOS Mm Hack) */
- MiSyncForProcessAttach(Thread, (PEPROCESS)Process);
/* Swap Processes */
KiSwapProcess(Process, SavedApcState->Process);
@@ -450,9 +447,6 @@
ASSERT_PROCESS(Process);
ASSERT_IRQL_LESS_OR_EQUAL(DISPATCH_LEVEL);
- /* Make sure that we are in the right page directory (ReactOS Mm Hack) */
- MiSyncForProcessAttach(Thread, (PEPROCESS)Process);
-
/* Check if we're already in that process */
if (Thread->ApcState.Process == Process) return;
Modified: trunk/reactos/ntoskrnl/ke/thrdobj.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/thrdobj.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/thrdobj.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/thrdobj.c [iso-8859-1] Mon Oct 18 14:34:35 2010
@@ -810,9 +810,6 @@
Thread->StackLimit = (ULONG_PTR)KernelStack - KERNEL_STACK_SIZE;
Thread->KernelStackResident = TRUE;
- /* Make sure that we are in the right page directory (ReactOS Mm Hack) */
- MiSyncForProcessAttach(Thread, (PEPROCESS)Process);
-
/* Enter SEH to avoid crashes due to user mode */
Status = STATUS_SUCCESS;
_SEH2_TRY
Modified: trunk/reactos/ntoskrnl/ke/thrdschd.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/thrdschd.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/thrdschd.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/thrdschd.c [iso-8859-1] Mon Oct 18 14:34:35 2010
@@ -385,9 +385,6 @@
/* Save the wait IRQL */
WaitIrql = CurrentThread->WaitIrql;
-
- /* REACTOS Mm Hack of Doom */
- MiSyncForContextSwitch(NextThread);
/* Swap contexts */
ApcState = KiSwapContext(CurrentThread, NextThread);
@@ -756,9 +753,6 @@
/* Sanity check */
ASSERT(OldIrql <= DISPATCH_LEVEL);
- /* REACTOS Mm Hack of Doom */
- MiSyncForContextSwitch(NextThread);
-
/* Swap to new thread */
KiSwapContext(Thread, NextThread);
Status = STATUS_SUCCESS;
Modified: trunk/reactos/ntoskrnl/mm/i386/page.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/i386/page.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/i386/page.c [iso-8859-1] Mon Oct 18 14:34:35 2010
@@ -910,54 +910,6 @@
}
VOID
-NTAPI
-MmUpdatePageDir(PEPROCESS Process, PVOID Address, ULONG Size)
-{
- ULONG StartOffset, EndOffset, Offset;
- PULONG Pde;
-
- //
- // Check if the process isn't there anymore
- // This is probably a bad sign, since it means the caller is setting cr3 to
- // 0 or something...
- //
- if ((PTE_TO_PFN(Process->Pcb.DirectoryTableBase[0]) == 0) && (Process !=
PsGetCurrentProcess()))
- {
- DPRINT1("Process: %16s is dead: %p\n", Process->ImageFileName,
Process->Pcb.DirectoryTableBase[0]);
- ASSERT(FALSE);
- return;
- }
-
- if (Address < MmSystemRangeStart)
- {
- KeBugCheck(MEMORY_MANAGEMENT);
- }
-
- StartOffset = ADDR_TO_PDE_OFFSET(Address);
- EndOffset = ADDR_TO_PDE_OFFSET((PVOID)((ULONG_PTR)Address + Size));
-
- if (Process != NULL && Process != PsGetCurrentProcess())
- {
- Pde =
MmCreateHyperspaceMapping(PTE_TO_PFN(Process->Pcb.DirectoryTableBase[0]));
- }
- else
- {
- Pde = (PULONG)PAGEDIRECTORY_MAP;
- }
- for (Offset = StartOffset; Offset <= EndOffset; Offset++)
- {
- if (Offset != ADDR_TO_PDE_OFFSET(PAGETABLE_MAP))
- {
- InterlockedCompareExchangePte(&Pde[Offset],
MmGlobalKernelPageDirectory[Offset], 0);
- }
- }
- if (Pde != (PULONG)PAGEDIRECTORY_MAP)
- {
- MmDeleteHyperspaceMapping(Pde);
- }
-}
-
-VOID
INIT_FUNCTION
NTAPI
MmInitGlobalKernelPageDirectory(VOID)
Modified: trunk/reactos/ntoskrnl/mm/mmfault.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/mmfault.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/mmfault.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/mmfault.c [iso-8859-1] Mon Oct 18 14:34:35 2010
@@ -16,37 +16,6 @@
#include "ARM3/miarm.h"
/* PRIVATE FUNCTIONS **********************************************************/
-
-VOID
-FASTCALL
-MiSyncForProcessAttach(IN PKTHREAD Thread,
- IN PEPROCESS Process)
-{
- PETHREAD Ethread = CONTAINING_RECORD(Thread, ETHREAD, Tcb);
-
- /* Hack Sync because Mm is broken */
- MmUpdatePageDir(Process, Ethread, sizeof(ETHREAD));
- MmUpdatePageDir(Process, Ethread->ThreadsProcess, sizeof(EPROCESS));
- MmUpdatePageDir(Process,
- (PVOID)Thread->StackLimit,
- Thread->LargeStack ?
- KERNEL_LARGE_STACK_SIZE : KERNEL_STACK_SIZE);
-}
-
-VOID
-FASTCALL
-MiSyncForContextSwitch(IN PKTHREAD Thread)
-{
- PVOID Process = PsGetCurrentProcess();
- PETHREAD Ethread = CONTAINING_RECORD(Thread, ETHREAD, Tcb);
-
- /* Hack Sync because Mm is broken */
- MmUpdatePageDir(Process, Ethread->ThreadsProcess, sizeof(EPROCESS));
- MmUpdatePageDir(Process,
- (PVOID)Thread->StackLimit,
- Thread->LargeStack ?
- KERNEL_LARGE_STACK_SIZE : KERNEL_STACK_SIZE);
-}
NTSTATUS
NTAPI