Set PTE frame for non-paged pool allocations
This commit is contained in:
@@ -41,6 +41,19 @@
|
|||||||
/* Number of reserved zeroed PTEs */
|
/* Number of reserved zeroed PTEs */
|
||||||
#define MM_RESERVED_ZERO_PTES 32
|
#define MM_RESERVED_ZERO_PTES 32
|
||||||
|
|
||||||
|
/* Memory Manager Protection Bits */
|
||||||
|
#define MM_ZERO_ACCESS 0
|
||||||
|
#define MM_READONLY 1
|
||||||
|
#define MM_EXECUTE 2
|
||||||
|
#define MM_EXECUTE_READ 3
|
||||||
|
#define MM_READWRITE 4
|
||||||
|
#define MM_WRITECOPY 5
|
||||||
|
#define MM_EXECUTE_READWRITE 6
|
||||||
|
#define MM_EXECUTE_WRITECOPY 7
|
||||||
|
#define MM_PROTECT_ACCESS 7
|
||||||
|
|
||||||
|
/* Protection field shift */
|
||||||
|
#define MM_PROTECT_FIELD_SHIFT 5
|
||||||
|
|
||||||
/* Memory manager page lists */
|
/* Memory manager page lists */
|
||||||
typedef enum _MMPAGELISTS
|
typedef enum _MMPAGELISTS
|
||||||
|
|||||||
@@ -151,11 +151,12 @@ MM::Allocator::AllocateNonPagedPoolPages(IN PFN_COUNT Pages,
|
|||||||
|
|
||||||
/* Initialize the PFN entry for the allocated physical page */
|
/* Initialize the PFN entry for the allocated physical page */
|
||||||
Pfn = MM::Pfn::GetPfnEntry(PageFrameNumber);
|
Pfn = MM::Pfn::GetPfnEntry(PageFrameNumber);
|
||||||
|
MM::Paging::SetPte(&Pfn->OriginalPte, 0, MM_READWRITE << MM_PROTECT_FIELD_SHIFT);
|
||||||
Pfn->PteAddress = CurrentPte;
|
Pfn->PteAddress = CurrentPte;
|
||||||
Pfn->u2.ShareCount = 1;
|
Pfn->u2.ShareCount = 1;
|
||||||
Pfn->u3.e1.PageLocation = ActiveAndValid;
|
Pfn->u3.e1.PageLocation = ActiveAndValid;
|
||||||
Pfn->u3.e2.ReferenceCount = 1;
|
Pfn->u3.e2.ReferenceCount = 1;
|
||||||
Pfn->u4.VerifierAllocation = 0;
|
Pfn->u4.PteFrame = MM::Paging::GetPageFrameNumber(MM::Paging::GetPteAddress(CurrentPte));
|
||||||
|
|
||||||
/* Build a valid PTE pointing to the allocated page frame */
|
/* Build a valid PTE pointing to the allocated page frame */
|
||||||
MM::Paging::SetPte(ValidPte, PageFrameNumber, 0);
|
MM::Paging::SetPte(ValidPte, PageFrameNumber, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user