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