Compare commits
4 Commits
xtldr_pml_
...
memmgr
| Author | SHA1 | Date | |
|---|---|---|---|
|
d263f17831
|
|||
|
6175413db2
|
|||
|
428928c7e1
|
|||
|
7d2b41a044
|
@@ -20,7 +20,7 @@ namespace KE
|
||||
public:
|
||||
STATIC XTAPI VOID HaltSystem(VOID);
|
||||
STATIC XTAPI VOID Panic(IN ULONG Code);
|
||||
STATIC XTAPI VOID PanicEx(IN ULONG Code,
|
||||
STATIC XTAPI VOID Panic(IN ULONG Code,
|
||||
IN ULONG_PTR Parameter1,
|
||||
IN ULONG_PTR Parameter2,
|
||||
IN ULONG_PTR Parameter3,
|
||||
|
||||
@@ -43,7 +43,7 @@ XTAPI
|
||||
VOID
|
||||
KE::Crash::Panic(IN ULONG Code)
|
||||
{
|
||||
PanicEx(Code, 0, 0, 0, 0);
|
||||
Panic(Code, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,7 +70,7 @@ KE::Crash::Panic(IN ULONG Code)
|
||||
*/
|
||||
XTAPI
|
||||
VOID
|
||||
KE::Crash::PanicEx(IN ULONG Code,
|
||||
KE::Crash::Panic(IN ULONG Code,
|
||||
IN ULONG_PTR Parameter1,
|
||||
IN ULONG_PTR Parameter2,
|
||||
IN ULONG_PTR Parameter3,
|
||||
|
||||
@@ -173,7 +173,7 @@ MM::Pfn::DecrementReferenceCount(IN PMMPFN PageFrameNumber,
|
||||
if(PageFrameNumber->u2.ShareCount)
|
||||
{
|
||||
/* This indicates a bug; crash the system */
|
||||
KE::Crash::PanicEx(0x4E,
|
||||
KE::Crash::Panic(0x4E,
|
||||
0x07,
|
||||
PageFrameIndex,
|
||||
PageFrameNumber->u2.ShareCount,
|
||||
@@ -256,7 +256,7 @@ MM::Pfn::DecrementShareCount(IN PMMPFN PageFrameNumber,
|
||||
(PageFrameNumber->u3.e1.PageLocation != StandbyPageList))
|
||||
{
|
||||
/* This indicates a bug; crash the system */
|
||||
KE::Crash::PanicEx(0x4E,
|
||||
KE::Crash::Panic(0x4E,
|
||||
0x99,
|
||||
PageFrameIndex,
|
||||
PageFrameNumber->u3.e1.PageLocation,
|
||||
@@ -591,7 +591,7 @@ MM::Pfn::LinkPage(IN PMMPFNLIST ListHead,
|
||||
MM::Paging::GetPteSoftwareTransition(&PageFrame->OriginalPte))
|
||||
{
|
||||
/* Crash system due to corrupted PFN/PTE state */
|
||||
KE::Crash::PanicEx(0x71, 0x8888, 0, 0, 0);
|
||||
KE::Crash::Panic(0x71, 0x8888, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -806,7 +806,7 @@ MM::Pfn::LinkPfn(IN PFN_NUMBER PageFrameIndex,
|
||||
if(Status != STATUS_SUCCESS)
|
||||
{
|
||||
/* Could not make the page table resident, crash system */
|
||||
KE::Crash::PanicEx(0x1,
|
||||
KE::Crash::Panic(0x1,
|
||||
(ULONG_PTR)0x61940,
|
||||
(ULONG_PTR)PointerPte,
|
||||
MM::Paging::GetPageFrameNumber(PointerPte),
|
||||
@@ -1034,7 +1034,7 @@ MM::Pfn::ProcessMemoryDescriptor(IN PFN_NUMBER BasePage,
|
||||
IN PFN_NUMBER PageCount,
|
||||
IN LOADER_MEMORY_TYPE MemoryType)
|
||||
{
|
||||
PVOID VirtualRangeStart, VirtualRangeEnd;
|
||||
PVOID VirtualAddress, VirtualRangeStart, VirtualRangeEnd;
|
||||
PFN_NUMBER PageNumber;
|
||||
PMMPDE PointerPde;
|
||||
PMMPFN Pfn;
|
||||
@@ -1087,8 +1087,12 @@ MM::Pfn::ProcessMemoryDescriptor(IN PFN_NUMBER BasePage,
|
||||
/* Ensure that the page is not already in-use */
|
||||
if(Pfn->u3.e2.ReferenceCount == 0)
|
||||
{
|
||||
/* Calculate the virtual address for this page */
|
||||
VirtualAddress = (PVOID)(KSEG0_BASE + ((BasePage + PageNumber) << MM_PAGE_SHIFT));
|
||||
PointerPde = MM::Paging::GetPdeAddress(VirtualAddress);
|
||||
|
||||
/* Initialize the PFN entry to represent a ROM page */
|
||||
Pfn->PteAddress = MM::Paging::GetPteAddress(VirtualRangeStart);
|
||||
Pfn->PteAddress = MM::Paging::GetPteAddress(VirtualAddress);
|
||||
Pfn->u1.Flink = 0;
|
||||
Pfn->u2.ShareCount = 0;
|
||||
Pfn->u3.e1.CacheAttribute = PfnCached;
|
||||
@@ -1117,8 +1121,12 @@ MM::Pfn::ProcessMemoryDescriptor(IN PFN_NUMBER BasePage,
|
||||
/* Ensure that the page is not already in-use */
|
||||
if(Pfn->u3.e2.ReferenceCount == 0)
|
||||
{
|
||||
/* Calculate the virtual address for this page */
|
||||
VirtualAddress = (PVOID)(KSEG0_BASE + ((BasePage + PageNumber) << MM_PAGE_SHIFT));
|
||||
PointerPde = MM::Paging::GetPdeAddress(VirtualAddress);
|
||||
|
||||
/* Initialize the PFN entry to represent an in-use page and prevent it from being allocated */
|
||||
Pfn->PteAddress = MM::Paging::GetPteAddress(VirtualRangeStart);
|
||||
Pfn->PteAddress = MM::Paging::GetPteAddress(VirtualAddress);
|
||||
Pfn->u2.ShareCount++;
|
||||
Pfn->u3.e1.CacheAttribute = PfnCached;
|
||||
Pfn->u3.e1.PageLocation = ActiveAndValid;
|
||||
|
||||
Reference in New Issue
Block a user