git://git.jankratochvil.net
/
reactos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update for HEAD-2003021201
[reactos.git]
/
ntoskrnl
/
mm
/
rmap.c
diff --git
a/ntoskrnl/mm/rmap.c
b/ntoskrnl/mm/rmap.c
index
056b906
..
2848be4
100644
(file)
--- a/
ntoskrnl/mm/rmap.c
+++ b/
ntoskrnl/mm/rmap.c
@@
-50,6
+50,7
@@
typedef struct _MM_RMAP_ENTRY
/* GLOBALS ******************************************************************/
static FAST_MUTEX RmapListLock;
/* GLOBALS ******************************************************************/
static FAST_MUTEX RmapListLock;
+static NPAGED_LOOKASIDE_LIST RmapLookasideList;
/* FUNCTIONS ****************************************************************/
/* FUNCTIONS ****************************************************************/
@@
-57,6
+58,13
@@
VOID
MmInitializeRmapList(VOID)
{
ExInitializeFastMutex(&RmapListLock);
MmInitializeRmapList(VOID)
{
ExInitializeFastMutex(&RmapListLock);
+ ExInitializeNPagedLookasideList (&RmapLookasideList,
+ NULL,
+ NULL,
+ 0,
+ sizeof(MM_RMAP_ENTRY),
+ TAG_RMAP,
+ 50);
}
NTSTATUS
}
NTSTATUS
@@
-104,6
+112,7
@@
MmWritePagePhysicalAddress(PHYSICAL_ADDRESS PhysicalAddress)
MemoryArea = MmOpenMemoryAreaByAddress(&Process->AddressSpace, Address);
if (MemoryArea == NULL)
{
MemoryArea = MmOpenMemoryAreaByAddress(&Process->AddressSpace, Address);
if (MemoryArea == NULL)
{
+ MmUnlockAddressSpace(&Process->AddressSpace);
ObDereferenceObject(Process);
return(STATUS_UNSUCCESSFUL);
}
ObDereferenceObject(Process);
return(STATUS_UNSUCCESSFUL);
}
@@
-355,7
+364,7
@@
MmInsertRmap(PHYSICAL_ADDRESS PhysicalAddress, PEPROCESS Process,
Address = (PVOID)PAGE_ROUND_DOWN(Address);
Address = (PVOID)PAGE_ROUND_DOWN(Address);
- new_entry = ExAllocate
PoolWithTag(NonPagedPool, sizeof(MM_RMAP_ENTRY), TAG_RMAP
);
+ new_entry = ExAllocate
FromNPagedLookasideList(&RmapLookasideList
);
if (new_entry == NULL)
{
KeBugCheck(0);
if (new_entry == NULL)
{
KeBugCheck(0);
@@
-404,7
+413,7
@@
MmDeleteAllRmaps(PHYSICAL_ADDRESS PhysicalAddress, PVOID Context,
DeleteMapping(Context, previous_entry->Process,
previous_entry->Address);
}
DeleteMapping(Context, previous_entry->Process,
previous_entry->Address);
}
- ExFree
Pool(
previous_entry);
+ ExFree
ToNPagedLookasideList(&RmapLookasideList,
previous_entry);
}
MmSetRmapListHeadPage(PhysicalAddress, NULL);
ExReleaseFastMutex(&RmapListLock);
}
MmSetRmapListHeadPage(PhysicalAddress, NULL);
ExReleaseFastMutex(&RmapListLock);
@@
-427,15
+436,13
@@
MmDeleteRmap(PHYSICAL_ADDRESS PhysicalAddress, PEPROCESS Process,
if (previous_entry == NULL)
{
MmSetRmapListHeadPage(PhysicalAddress, current_entry->Next);
if (previous_entry == NULL)
{
MmSetRmapListHeadPage(PhysicalAddress, current_entry->Next);
- ExReleaseFastMutex(&RmapListLock);
- ExFreePool(current_entry);
}
else
{
previous_entry->Next = current_entry->Next;
}
else
{
previous_entry->Next = current_entry->Next;
- ExReleaseFastMutex(&RmapListLock);
- ExFreePool(current_entry);
}
}
+ ExReleaseFastMutex(&RmapListLock);
+ ExFreeToNPagedLookasideList(&RmapLookasideList, current_entry);
return;
}
previous_entry = current_entry;
return;
}
previous_entry = current_entry;