Remove temporary hack and allocate processor structures from non-paged pool
This commit is contained in:
@@ -45,9 +45,6 @@ PVOID MM::HardwarePool::HardwareHeapStart = MM_HARDWARE_HEAP_START_ADDRESS;
|
||||
/* Number of used hardware allocation descriptors */
|
||||
ULONG MM::HardwarePool::UsedHardwareAllocationDescriptors = 0;
|
||||
|
||||
/* Processor structures data (THIS IS A TEMPORARY HACK) */
|
||||
UCHAR MM::KernelPool::ProcessorStructuresData[MAXIMUM_PROCESSORS][KPROCESSOR_STRUCTURES_SIZE] = {{0}};
|
||||
|
||||
/* Global structure describing the virtual memory layout of the system */
|
||||
MMMEMORY_LAYOUT MM::Manager::MemoryLayout;
|
||||
|
||||
|
||||
@@ -113,12 +113,15 @@ MM::KernelPool::AllocateProcessorStructures(IN ULONG CpuNumber,
|
||||
PKPROCESSOR_BLOCK ProcessorBlock;
|
||||
PVOID ProcessorStructures;
|
||||
UINT_PTR Address;
|
||||
XTSTATUS Status;
|
||||
|
||||
/* Not implemented yet, this is just a hack */
|
||||
UNIMPLEMENTED;
|
||||
|
||||
/* Assign memory for processor structures from preallocated buffer */
|
||||
ProcessorStructures = &ProcessorStructuresData[CpuNumber - 1];
|
||||
/* Assign memory for processor structures */
|
||||
Status = MM::Allocator::AllocatePool(NonPagedPool, KPROCESSOR_STRUCTURES_SIZE, &ProcessorStructures);
|
||||
if(Status != STATUS_SUCCESS)
|
||||
{
|
||||
/* Failed to allocate memory, return status code */
|
||||
return Status;
|
||||
}
|
||||
|
||||
/* Make sure all structures are zeroed */
|
||||
RTL::Memory::ZeroMemory(ProcessorStructures, KPROCESSOR_STRUCTURES_SIZE);
|
||||
|
||||
Reference in New Issue
Block a user