- Replaced MP with CONFIG_SMP. - Used interlocked function for accessing the page directories/tables. Modified: trunk/reactos/ntoskrnl/mm/i386/page.c _____
Modified: trunk/reactos/ntoskrnl/mm/i386/page.c --- trunk/reactos/ntoskrnl/mm/i386/page.c 2005-01-05 19:26:51 UTC (rev 12833) +++ trunk/reactos/ntoskrnl/mm/i386/page.c 2005-01-05 19:27:58 UTC (rev 12834) @@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: page.c,v 1.80 2004/12/30 08:05:11 hyperion Exp $ +/* $Id$ * * PROJECT: ReactOS kernel * FILE: ntoskrnl/mm/i386/page.c @@ -106,7 +106,7 @@ VOID MiFlushTlb(PULONG Pt, PVOID Address) { -#ifdef MP +#ifdef CONFIG_SMP if (Pt) { MmUnmapPageTable(Pt); @@ -635,7 +635,7 @@ { KEBUGCHECK(0); } - if (PageDir[PdeOffset] == 0) + if (0 == InterlockedCompareExchangeUL(&PageDir[PdeOffset], 0, 0)) { if (Create == FALSE) { @@ -667,11 +667,11 @@ return Pt + ADDR_TO_PTE_OFFSET(Address); } PageDir = ADDR_TO_PDE(Address); - if (*PageDir == 0) + if (0 == InterlockedCompareExchangeUL(PageDir, 0, 0)) { if (Address >= (PVOID)KERNEL_BASE) { - if (MmGlobalKernelPageDirectory[PdeOffset] == 0) + if (0 == InterlockedCompareExchangeUL(&MmGlobalKernelPageDirectory[PdeOffset], 0, 0)) { if (Create == FALSE) { @@ -692,7 +692,7 @@ MmReleasePageMemoryConsumer(MC_NPPOOL, Pfn); } } - *PageDir =MmGlobalKernelPageDirectory[PdeOffset]; + InterlockedExchangeUL(PageDir, MmGlobalKernelPageDirectory[PdeOffset]); } else { @@ -907,7 +907,7 @@ /* * Set the entry to zero */ - *Pt = 0; + InterlockedExchangeUL(Pt, 0); MiFlushTlb(Pt, Address); } } @@ -1596,7 +1596,7 @@ { KEBUGCHECK(0); } - *Pt = PFN_TO_PTE(Pages[i]) | Attributes; + InterlockedExchangeUL(Pt, PFN_TO_PTE(Pages[i]) | Attributes); } }
@@ -1665,7 +1665,7 @@ { MmMarkPageUnmapped(PTE_TO_PFN((Pte))); } - *Pt = SwapEntry << 1; + InterlockedExchangeUL(Pt, SwapEntry << 1); if (Pte != 0) { MiFlushTlb(Pt, Address); @@ -1866,7 +1866,7 @@ { MmMarkPageUnmapped(PTE_TO_PFN((Pte))); } - *Pt = PFN_TO_PTE(Pages[i]) | Attributes; + InterlockedExchangeUL(Pt, PFN_TO_PTE(Pages[i]) | Attributes); if (Address < (PVOID)KERNEL_BASE && Process->AddressSpace.PageTableRefCountTable != NULL && Attributes & PA_PRESENT) @@ -2027,7 +2027,7 @@ { KEBUGCHECK(0); } - *Pt = PAGE_MASK(*Pt) | Attributes | (*Pt & (PA_ACCESSED|PA_DIRTY)); + InterlockedExchange(Pt, PAGE_MASK(*Pt) | Attributes | (*Pt & (PA_ACCESSED|PA_DIRTY))); MiFlushTlb(Pt, Address); } } @@ -2174,6 +2174,7 @@ if (Ke386GlobalPagesEnabled) { MmGlobalKernelPageDirectoryForPAE[i] |= PA_GLOBAL; + CurrentPageDirectory[i] |= PA_GLOBAL; } } } @@ -2190,6 +2191,7 @@ if (Ke386GlobalPagesEnabled) { MmGlobalKernelPageDirectory[i] |= PA_GLOBAL; + CurrentPageDirectory[i] |= PA_GLOBAL; } } }