Replace writable flag with AttributesMask in PTE setup
This commit is contained in:
@@ -52,7 +52,7 @@ namespace MM
|
||||
IN BOOLEAN Value);
|
||||
XTAPI VOID SetPte(IN PMMPTE PtePointer,
|
||||
IN PFN_NUMBER PageFrameNumber,
|
||||
IN BOOLEAN Writable);
|
||||
IN ULONG_PTR AttributesMask);
|
||||
XTAPI VOID SetPteCaching(IN PMMPTE PtePointer,
|
||||
IN BOOLEAN CacheDisable,
|
||||
IN BOOLEAN WriteThrough);
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace MM
|
||||
IN BOOLEAN Value) = 0;
|
||||
VIRTUAL XTAPI VOID SetPte(IN PMMPTE PtePointer,
|
||||
IN PFN_NUMBER PageFrameNumber,
|
||||
IN BOOLEAN Writable) = 0;
|
||||
IN ULONG_PTR AttributesMask) = 0;
|
||||
VIRTUAL XTAPI VOID SetPteCaching(IN PMMPTE PtePointer,
|
||||
IN BOOLEAN CacheDisable,
|
||||
IN BOOLEAN WriteThrough) = 0;
|
||||
@@ -69,7 +69,7 @@ namespace MM
|
||||
IN BOOLEAN Value);
|
||||
XTAPI VOID SetPte(IN PMMPTE PtePointer,
|
||||
IN PFN_NUMBER PageFrameNumber,
|
||||
IN BOOLEAN Writable);
|
||||
IN ULONG_PTR AttributesMask);
|
||||
XTAPI VOID SetPteCaching(IN PMMPTE PtePointer,
|
||||
IN BOOLEAN CacheDisable,
|
||||
IN BOOLEAN WriteThrough);
|
||||
@@ -92,7 +92,7 @@ namespace MM
|
||||
IN BOOLEAN Value);
|
||||
XTAPI VOID SetPte(IN PMMPTE PtePointer,
|
||||
IN PFN_NUMBER PageFrameNumber,
|
||||
IN BOOLEAN Writable);
|
||||
IN ULONG_PTR AttributesMask);
|
||||
XTAPI VOID SetPteCaching(IN PMMPTE PtePointer,
|
||||
IN BOOLEAN CacheDisable,
|
||||
IN BOOLEAN WriteThrough);
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace MM
|
||||
IN BOOLEAN Value);
|
||||
STATIC XTAPI VOID SetPte(IN PMMPTE PtePointer,
|
||||
IN PFN_NUMBER PageFrameNumber,
|
||||
IN BOOLEAN Writable);
|
||||
IN ULONG_PTR AttributesMask);
|
||||
STATIC XTAPI VOID SetPteCaching(IN PMMPTE PtePointer,
|
||||
IN BOOLEAN CacheDisable,
|
||||
IN BOOLEAN WriteThrough);
|
||||
|
||||
@@ -487,8 +487,8 @@ MM::PageMap::SetOneEntry(IN PMMPTE Pte,
|
||||
* @param PageFrameNumber
|
||||
* Physical frame number to map.
|
||||
*
|
||||
* @param Writable
|
||||
* Indicates whether the page should be writable.
|
||||
* @param AttributesMask
|
||||
* Specifies the attributes mask to apply to the PTE.
|
||||
*
|
||||
* @return This routine does not return any value.
|
||||
*
|
||||
@@ -498,12 +498,12 @@ XTAPI
|
||||
VOID
|
||||
MM::PageMap::SetPte(IN PMMPTE PtePointer,
|
||||
IN PFN_NUMBER PageFrameNumber,
|
||||
IN BOOLEAN Writable)
|
||||
IN ULONG_PTR AttributesMask)
|
||||
{
|
||||
/* Set PTE */
|
||||
PtePointer->Hardware.PageFrameNumber = PageFrameNumber;
|
||||
PtePointer->Hardware.Valid = 1;
|
||||
PtePointer->Hardware.Writable = Writable;
|
||||
PtePointer->Long |= AttributesMask;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -222,7 +222,7 @@ MM::HardwarePool::MapHardwareMemory(IN PHYSICAL_ADDRESS PhysicalAddress,
|
||||
PtePointer = MM::Paging::GetPteAddress(BaseAddress);
|
||||
|
||||
/* Fill the PTE */
|
||||
MM::Paging::SetPte(PtePointer, (PFN_NUMBER)(PhysicalAddress.QuadPart >> MM_PAGE_SHIFT), TRUE);
|
||||
MM::Paging::SetPte(PtePointer, (PFN_NUMBER)(PhysicalAddress.QuadPart >> MM_PAGE_SHIFT), MM_PTE_READWRITE);
|
||||
|
||||
/* Advance to the next address */
|
||||
PhysicalAddress.QuadPart += MM_PAGE_SIZE;
|
||||
@@ -302,7 +302,7 @@ MM::HardwarePool::RemapHardwareMemory(IN PVOID VirtualAddress,
|
||||
PtePointer = MM::Paging::GetPteAddress(VirtualAddress);
|
||||
|
||||
/* Remap the PTE */
|
||||
MM::Paging::SetPte(PtePointer, (PFN_NUMBER)(PhysicalAddress.QuadPart >> MM_PAGE_SHIFT), TRUE);
|
||||
MM::Paging::SetPte(PtePointer, (PFN_NUMBER)(PhysicalAddress.QuadPart >> MM_PAGE_SHIFT), MM_PTE_READWRITE);
|
||||
|
||||
/* Check if TLB needs to be flushed */
|
||||
if(FlushTlb)
|
||||
|
||||
@@ -398,8 +398,8 @@ MM::PageMapBasic::SetOneEntry(IN PMMPTE Pte,
|
||||
* @param PageFrameNumber
|
||||
* Physical frame number to map.
|
||||
*
|
||||
* @param Writable
|
||||
* Indicates whether the page should be writable.
|
||||
* @param AttributesMask
|
||||
* Specifies the attributes mask to apply to the PTE.
|
||||
*
|
||||
* @return This routine does not return any value.
|
||||
*
|
||||
@@ -409,12 +409,12 @@ XTAPI
|
||||
VOID
|
||||
MM::PageMapBasic::SetPte(IN PMMPTE PtePointer,
|
||||
IN PFN_NUMBER PageFrameNumber,
|
||||
IN BOOLEAN Writable)
|
||||
IN ULONG_PTR AttributesMask)
|
||||
{
|
||||
/* Set PTE */
|
||||
PtePointer->Pml2.Hardware.PageFrameNumber = PageFrameNumber;
|
||||
PtePointer->Pml2.Hardware.Valid = 1;
|
||||
PtePointer->Pml2.Hardware.Writable = Writable;
|
||||
PtePointer->Long |= AttributesMask;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -631,8 +631,8 @@ MM::PageMapXpa::SetOneEntry(IN PMMPTE Pte,
|
||||
* @param PageFrameNumber
|
||||
* Physical frame number to map.
|
||||
*
|
||||
* @param Writable
|
||||
* Indicates whether the page should be writable.
|
||||
* @param AttributesMask
|
||||
* Specifies the attributes mask to apply to the PTE.
|
||||
*
|
||||
* @return This routine does not return any value.
|
||||
*
|
||||
@@ -642,12 +642,12 @@ XTAPI
|
||||
VOID
|
||||
MM::PageMapXpa::SetPte(IN PMMPTE PtePointer,
|
||||
IN PFN_NUMBER PageFrameNumber,
|
||||
IN BOOLEAN Writable)
|
||||
IN ULONG_PTR AttributesMask)
|
||||
{
|
||||
/* Set PTE */
|
||||
PtePointer->Pml3.Hardware.PageFrameNumber = PageFrameNumber;
|
||||
PtePointer->Pml3.Hardware.Valid = 1;
|
||||
PtePointer->Pml3.Hardware.Writable = Writable;
|
||||
PtePointer->Long |= AttributesMask;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -371,8 +371,8 @@ MM::Paging::SetOneEntry(IN PMMPTE Pte,
|
||||
* @param PageFrameNumber
|
||||
* Physical frame number to map.
|
||||
*
|
||||
* @param Writable
|
||||
* Indicates whether the page should be writable.
|
||||
* @param AttributesMask
|
||||
* Specifies the attributes mask to apply to the PTE.
|
||||
*
|
||||
* @return This routine does not return any value.
|
||||
*
|
||||
@@ -382,10 +382,10 @@ XTAPI
|
||||
VOID
|
||||
MM::Paging::SetPte(IN PMMPTE PtePointer,
|
||||
IN PFN_NUMBER PageFrameNumber,
|
||||
IN BOOLEAN Writable)
|
||||
IN ULONG_PTR AttributesMask)
|
||||
{
|
||||
/* Set PTE */
|
||||
PmlRoutines->SetPte(PtePointer, PageFrameNumber, (BOOLEAN)Writable);
|
||||
PmlRoutines->SetPte(PtePointer, PageFrameNumber, AttributesMask);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user