Refactor big allocation tracker to use Tag
This commit is contained in:
@@ -33,8 +33,9 @@
|
||||
#define MM_POOL_INVALID_ALLOC_RUNLEVEL 8
|
||||
#define MM_POOL_INVALID_FREE_RUNLEVEL 9
|
||||
|
||||
/* Big allocations entry flags */
|
||||
/* Pool flags */
|
||||
#define MM_POOL_BIG_ALLOCATIONS_ENTRY_FREE 0x1
|
||||
#define MM_POOL_RAISE_EXCEPTION 0x10
|
||||
|
||||
/* Number of reserved zeroed PTEs */
|
||||
#define MM_RESERVED_ZERO_PTES 32
|
||||
@@ -225,10 +226,10 @@ typedef struct _POOL_HEADER
|
||||
/* Pool descriptor structure definition */
|
||||
typedef struct _POOL_TRACKER_BIG_ALLOCATIONS
|
||||
{
|
||||
PVOID VirtualAddress;
|
||||
ULONG Key;
|
||||
ULONG NumberOfPages;
|
||||
PVOID QuotaObject;
|
||||
ULONG Tag;
|
||||
PVOID VirtualAddress;
|
||||
} POOL_TRACKER_BIG_ALLOCATIONS, *PPOOL_TRACKER_BIG_ALLOCATIONS;
|
||||
|
||||
#endif /* __XTDK_MMTYPES_H */
|
||||
|
||||
@@ -1282,8 +1282,8 @@ MM::Allocator::InitializeBigAllocationsTable(VOID)
|
||||
* @param VirtualAddress
|
||||
* Supplies the virtual address of the big allocation.
|
||||
*
|
||||
* @param Key
|
||||
* Supplies the key used to identify the allocation.
|
||||
* @param Tag
|
||||
* Supplies the tag used to identify the allocation.
|
||||
*
|
||||
* @param NumberOfPages
|
||||
* Supplies the number of physical pages backing the allocation.
|
||||
@@ -1298,7 +1298,7 @@ MM::Allocator::InitializeBigAllocationsTable(VOID)
|
||||
BOOLEAN
|
||||
XTAPI
|
||||
MM::Allocator::RegisterBigAllocationTag(IN PVOID VirtualAddress,
|
||||
IN ULONG Key,
|
||||
IN ULONG Tag,
|
||||
IN ULONG NumberOfPages,
|
||||
IN MMPOOL_TYPE PoolType)
|
||||
{
|
||||
@@ -1336,8 +1336,8 @@ MM::Allocator::RegisterBigAllocationTag(IN PVOID VirtualAddress,
|
||||
if((ULONG_PTR)Entry->VirtualAddress & MM_POOL_BIG_ALLOCATIONS_ENTRY_FREE)
|
||||
{
|
||||
/* Populate the available bucket with the allocation metadata */
|
||||
Entry->Key = Key;
|
||||
Entry->NumberOfPages = NumberOfPages;
|
||||
Entry->Tag = Tag;
|
||||
Entry->VirtualAddress = VirtualAddress;
|
||||
|
||||
/* Increment the global usage counter */
|
||||
@@ -1455,7 +1455,7 @@ MM::Allocator::UnregisterBigAllocationTag(IN PVOID VirtualAddress,
|
||||
{
|
||||
/* Capture the allocation metadata */
|
||||
*NumberOfPages = Entry->NumberOfPages;
|
||||
PoolTag = Entry->Key;
|
||||
PoolTag = Entry->Tag;
|
||||
|
||||
/* Invalidate the entry */
|
||||
Entry->VirtualAddress = (PVOID)MM_POOL_BIG_ALLOCATIONS_ENTRY_FREE;
|
||||
|
||||
Reference in New Issue
Block a user