Replace writable flag with AttributesMask in PTE setup
All checks were successful
Builds / ExectOS (amd64, release) (push) Successful in 29s
Builds / ExectOS (amd64, debug) (push) Successful in 33s
Builds / ExectOS (i686, debug) (push) Successful in 31s
Builds / ExectOS (i686, release) (push) Successful in 30s

This commit is contained in:
2025-11-04 17:34:49 +01:00
parent dda8f88830
commit 071c840ca8
7 changed files with 23 additions and 23 deletions

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;
}
/**

View File

@@ -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)

View File

@@ -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;
}
/**

View File

@@ -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);
}
/**