Remove leftover old headers and fix missed spots
This commit is contained in:
@@ -34,7 +34,7 @@ MM::HardwarePool::AllocateHardwareMemory(IN PFN_NUMBER PageCount,
|
||||
PLOADER_MEMORY_DESCRIPTOR Descriptor, ExtraDescriptor, HardwareDescriptor;
|
||||
PFN_NUMBER Alignment, MaxPage;
|
||||
ULONGLONG PhysicalAddress;
|
||||
PLIST_ENTRY ListEntry;
|
||||
PLIST_ENTRY ListEntry, LoaderMemoryDescriptors;
|
||||
|
||||
/* Assume failure */
|
||||
(*Buffer).QuadPart = 0;
|
||||
@@ -49,9 +49,12 @@ MM::HardwarePool::AllocateHardwareMemory(IN PFN_NUMBER PageCount,
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
}
|
||||
|
||||
/* Get a list of memory descriptors provided by the boot loader */
|
||||
LoaderMemoryDescriptors = KE::BootInformation::GetMemoryDescriptors();
|
||||
|
||||
/* Scan memory descriptors provided by the boot loader */
|
||||
ListEntry = KeGetInitializationBlock()->MemoryDescriptorListHead.Flink;
|
||||
while(ListEntry != &KeGetInitializationBlock()->MemoryDescriptorListHead)
|
||||
ListEntry = LoaderMemoryDescriptors->Flink;
|
||||
while(ListEntry != LoaderMemoryDescriptors)
|
||||
{
|
||||
Descriptor = CONTAIN_RECORD(ListEntry, LOADER_MEMORY_DESCRIPTOR, ListEntry);
|
||||
|
||||
@@ -77,7 +80,7 @@ MM::HardwarePool::AllocateHardwareMemory(IN PFN_NUMBER PageCount,
|
||||
}
|
||||
|
||||
/* Make sure we found a descriptor */
|
||||
if(ListEntry == &KeGetInitializationBlock()->MemoryDescriptorListHead)
|
||||
if(ListEntry == LoaderMemoryDescriptors)
|
||||
{
|
||||
/* Descriptor not found, return error */
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
|
@@ -28,7 +28,7 @@ MM::Init::InitializeMemoryManager(VOID)
|
||||
{
|
||||
/* Insufficient physical pages, kernel panic */
|
||||
DebugPrint(L"Insufficient physical pages! Install additional memory\n");
|
||||
KePanic(0);
|
||||
KE::Crash::Panic(0);
|
||||
}
|
||||
|
||||
/* Proceed with architecture specific initialization */
|
||||
@@ -46,16 +46,19 @@ XTAPI
|
||||
VOID
|
||||
MM::Init::ScanMemoryDescriptors(VOID)
|
||||
{
|
||||
PLIST_ENTRY LoaderMemoryDescriptors, MemoryMappings;
|
||||
PLOADER_MEMORY_DESCRIPTOR MemoryDescriptor;
|
||||
PLIST_ENTRY MemoryMappings;
|
||||
PFN_NUMBER FreePages;
|
||||
|
||||
/* Initially, set number of free pages to 0 */
|
||||
FreePages = 0;
|
||||
|
||||
/* Get a list of memory descriptors provided by the boot loader */
|
||||
LoaderMemoryDescriptors = KE::BootInformation::GetMemoryDescriptors();
|
||||
|
||||
/* Iterate through memory mappings provided by the boot loader */
|
||||
MemoryMappings = KeGetInitializationBlock()->MemoryDescriptorListHead.Flink;
|
||||
while(MemoryMappings != &KeGetInitializationBlock()->MemoryDescriptorListHead)
|
||||
MemoryMappings = LoaderMemoryDescriptors->Flink;
|
||||
while(MemoryMappings != LoaderMemoryDescriptors)
|
||||
{
|
||||
/* Get memory descriptor */
|
||||
MemoryDescriptor = CONTAIN_RECORD(MemoryMappings, LOADER_MEMORY_DESCRIPTOR, ListEntry);
|
||||
|
Reference in New Issue
Block a user