Author: akhaldi
Date: Fri Jan 27 15:24:58 2012
New Revision: 55247
URL:
http://svn.reactos.org/svn/reactos?rev=55247&view=rev
Log:
[NTOSKRNL]
* Laa-a-a-a-dies and gentlemen..... It was a deferred success. Move along mes chers, you
make the place look crowded.
Modified:
trunk/reactos/ntoskrnl/include/internal/mm.h
trunk/reactos/ntoskrnl/ke/i386/thrdini.c
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] Fri Jan 27 15:24:58 2012
@@ -5,20 +5,6 @@
/* TYPES *********************************************************************/
struct _EPROCESS;
-
-/* ReactOS Mm Hacks */
-VOID
-FASTCALL
-MiSyncForProcessAttach(
- IN PKTHREAD NextThread,
- IN PEPROCESS Process
-);
-
-VOID
-FASTCALL
-MiSyncForContextSwitch(
- IN PKTHREAD Thread
-);
extern PMMSUPPORT MmKernelAddressSpace;
extern PFN_COUNT MiFreeSwapPages;
Modified: trunk/reactos/ntoskrnl/ke/i386/thrdini.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/thrdini.c…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/thrdini.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/i386/thrdini.c [iso-8859-1] Fri Jan 27 15:24:58 2012
@@ -433,9 +433,6 @@
/* Get thread pointers */
OldThread = (PKTHREAD)(OldThreadAndApcFlag & ~3);
NewThread = Pcr->PrcbData.CurrentThread;
-
- /* ReactOS Mm Hack */
- MiSyncForContextSwitch(NewThread);
/* Get the old thread and set its kernel stack */
OldThread->KernelStack = SwitchFrame;
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] Fri Jan 27 15:24:58 2012
@@ -97,9 +97,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);
@@ -618,9 +615,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(Thread->ApcState.Process, Process);
@@ -788,9 +782,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(Thread->ApcState.Process, Process);
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] Fri Jan 27 15:24:58 2012
@@ -856,9 +856,6 @@
Thread->StackBase = KernelStack;
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;
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] Fri Jan 27 15:24:58 2012
@@ -394,9 +394,6 @@
/* Save the wait IRQL */
WaitIrql = CurrentThread->WaitIrql;
- /* REACTOS Mm Hack of Doom */
- MiSyncForContextSwitch(NextThread);
-
/* Swap contexts */
ApcState = KiSwapContext(WaitIrql, CurrentThread);
@@ -793,9 +790,6 @@
/* Sanity check */
ASSERT(OldIrql <= DISPATCH_LEVEL);
- /* REACTOS Mm Hack of Doom */
- MiSyncForContextSwitch(NextThread);
-
/* Swap to new thread */
KiSwapContext(APC_LEVEL, Thread);
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] Fri Jan 27 15:24:58 2012
@@ -1029,54 +1029,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] Fri Jan 27 15:24:58 2012
@@ -19,41 +19,6 @@
#include "ARM3/miarm.h"
/* PRIVATE FUNCTIONS **********************************************************/
-
-VOID
-FASTCALL
-MiSyncForProcessAttach(IN PKTHREAD Thread,
- IN PEPROCESS Process)
-{
- PETHREAD Ethread = CONTAINING_RECORD(Thread, ETHREAD, Tcb);
- //DPRINT1("Hack sync for process: %p and thread: %p\n", Process, Thread);
- //DPRINT1("Thread stack hack: %p %d\n", Thread->StackLimit,
Thread->LargeStack);
-
- /* 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);
- //DPRINT1("Hack sync for thread: %p and process: %p\n", Thread, Process);
- //DPRINT1("Thread stack hack: %p %d\n", Thread->StackLimit,
Thread->LargeStack);
-
- /* 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