From 48632d639913d858ecd55c33533513318a9462f7 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Sun, 15 Feb 2004 19:03:29 +0000 Subject: [PATCH] - Locked the pages in MmCommitPagedPoolAddress, if it is necessary. svn path=/trunk/; revision=8199 --- reactos/ntoskrnl/include/internal/mm.h | 2 +- reactos/ntoskrnl/mm/mm.c | 10 +++++++--- reactos/ntoskrnl/mm/ppool.c | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/reactos/ntoskrnl/include/internal/mm.h b/reactos/ntoskrnl/include/internal/mm.h index a21bf7e3355..b58a80dfbcf 100644 --- a/reactos/ntoskrnl/include/internal/mm.h +++ b/reactos/ntoskrnl/include/internal/mm.h @@ -479,7 +479,7 @@ NTSTATUS MmCreateVirtualMappingForKernel(PVOID Address, ULONG flProtect, PHYSICAL_ADDRESS PhysicalAddress); -NTSTATUS MmCommitPagedPoolAddress(PVOID Address); +NTSTATUS MmCommitPagedPoolAddress(PVOID Address, BOOLEAN Locked); NTSTATUS MmCreateVirtualMapping(struct _EPROCESS* Process, PVOID Address, ULONG flProtect, diff --git a/reactos/ntoskrnl/mm/mm.c b/reactos/ntoskrnl/mm/mm.c index e6ac1844430..648bab6f042 100644 --- a/reactos/ntoskrnl/mm/mm.c +++ b/reactos/ntoskrnl/mm/mm.c @@ -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: mm.c,v 1.67 2003/12/30 18:52:05 fireball Exp $ +/* $Id: mm.c,v 1.68 2004/02/15 19:03:29 hbirr Exp $ * * COPYRIGHT: See COPYING in the top directory * PROJECT: ReactOS kernel @@ -251,7 +251,7 @@ NTSTATUS MmAccessFault(KPROCESSOR_MODE Mode, return(Status); } -NTSTATUS MmCommitPagedPoolAddress(PVOID Address) +NTSTATUS MmCommitPagedPoolAddress(PVOID Address, BOOLEAN Locked) { NTSTATUS Status; PHYSICAL_ADDRESS AllocatedPage; @@ -279,6 +279,10 @@ NTSTATUS MmCommitPagedPoolAddress(PVOID Address) FALSE); MmLockAddressSpace(MmGetKernelAddressSpace()); } + if (Locked) + { + MmLockPage(AllocatedPage); + } return(Status); } @@ -348,7 +352,7 @@ NTSTATUS MmNotPresentFault(KPROCESSOR_MODE Mode, { case MEMORY_AREA_PAGED_POOL: { - Status = MmCommitPagedPoolAddress((PVOID)Address); + Status = MmCommitPagedPoolAddress((PVOID)Address, Locked); break; } diff --git a/reactos/ntoskrnl/mm/ppool.c b/reactos/ntoskrnl/mm/ppool.c index f316a65e92e..45ce5492777 100644 --- a/reactos/ntoskrnl/mm/ppool.c +++ b/reactos/ntoskrnl/mm/ppool.c @@ -1,4 +1,4 @@ -/* $Id: ppool.c,v 1.24 2003/12/30 18:52:05 fireball Exp $ +/* $Id: ppool.c,v 1.25 2004/02/15 19:03:29 hbirr Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -80,7 +80,7 @@ MmInitializePagedPool(VOID) * We are still at a high IRQL level at this point so explicitly commit * the first page of the paged pool before writing the first block header. */ - MmCommitPagedPoolAddress((PVOID)MmPagedPoolFirstFreeBlock); + MmCommitPagedPoolAddress((PVOID)MmPagedPoolFirstFreeBlock, FALSE); MmPagedPoolFirstFreeBlock->Size = MmPagedPoolSize; MmPagedPoolFirstFreeBlock->NextFree = NULL;