Decouple processor block initialization from AllocateProcessorStructures
All checks were successful
All checks were successful
This commit is contained in:
@@ -20,8 +20,7 @@ namespace MM
|
|||||||
public:
|
public:
|
||||||
STATIC XTAPI XTSTATUS AllocateKernelStack(OUT PVOID *Stack,
|
STATIC XTAPI XTSTATUS AllocateKernelStack(OUT PVOID *Stack,
|
||||||
IN ULONG StackSize);
|
IN ULONG StackSize);
|
||||||
STATIC XTAPI XTSTATUS AllocateProcessorStructures(IN ULONG CpuNumber,
|
STATIC XTAPI XTSTATUS AllocateProcessorStructures(OUT PVOID *StructuresData);
|
||||||
OUT PVOID *StructuresData);
|
|
||||||
STATIC XTAPI VOID FreeKernelStack(IN PVOID Stack,
|
STATIC XTAPI VOID FreeKernelStack(IN PVOID Stack,
|
||||||
IN ULONG StackSize);
|
IN ULONG StackSize);
|
||||||
STATIC XTAPI VOID FreeProcessorStructures(IN PVOID StructuresData);
|
STATIC XTAPI VOID FreeProcessorStructures(IN PVOID StructuresData);
|
||||||
|
|||||||
@@ -95,9 +95,6 @@ MM::KernelPool::AllocateKernelStack(OUT PVOID *Stack,
|
|||||||
/**
|
/**
|
||||||
* Allocates a buffer for structures needed by a processor and assigns it to a corresponding CPU.
|
* Allocates a buffer for structures needed by a processor and assigns it to a corresponding CPU.
|
||||||
*
|
*
|
||||||
* @param CpuNumber
|
|
||||||
* Specifies the zero-indexed CPU number as an owner of the allocated structures.
|
|
||||||
*
|
|
||||||
* @param StructuresData
|
* @param StructuresData
|
||||||
* Supplies a pointer to the memory area that will contain the allocated buffer.
|
* Supplies a pointer to the memory area that will contain the allocated buffer.
|
||||||
*
|
*
|
||||||
@@ -107,12 +104,9 @@ MM::KernelPool::AllocateKernelStack(OUT PVOID *Stack,
|
|||||||
*/
|
*/
|
||||||
XTAPI
|
XTAPI
|
||||||
XTSTATUS
|
XTSTATUS
|
||||||
MM::KernelPool::AllocateProcessorStructures(IN ULONG CpuNumber,
|
MM::KernelPool::AllocateProcessorStructures(OUT PVOID *StructuresData)
|
||||||
OUT PVOID *StructuresData)
|
|
||||||
{
|
{
|
||||||
PKPROCESSOR_BLOCK ProcessorBlock;
|
|
||||||
PVOID ProcessorStructures;
|
PVOID ProcessorStructures;
|
||||||
UINT_PTR Address;
|
|
||||||
XTSTATUS Status;
|
XTSTATUS Status;
|
||||||
|
|
||||||
/* Assign memory for processor structures */
|
/* Assign memory for processor structures */
|
||||||
@@ -126,15 +120,6 @@ MM::KernelPool::AllocateProcessorStructures(IN ULONG CpuNumber,
|
|||||||
/* 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);
|
||||||
|
|
||||||
/* Align address to page size boundary and find a space for processor block */
|
|
||||||
Address = ROUND_UP((UINT_PTR)ProcessorStructures, MM_PAGE_SIZE);
|
|
||||||
ProcessorBlock = (PKPROCESSOR_BLOCK)((PUCHAR)Address +
|
|
||||||
(KERNEL_STACKS * KERNEL_STACK_SIZE) +
|
|
||||||
(GDT_ENTRIES * sizeof(KGDTENTRY)));
|
|
||||||
|
|
||||||
/* Store processor number in the processor block */
|
|
||||||
ProcessorBlock->CpuNumber = CpuNumber;
|
|
||||||
|
|
||||||
/* Return pointer to the processor structures */
|
/* Return pointer to the processor structures */
|
||||||
*StructuresData = ProcessorStructures;
|
*StructuresData = ProcessorStructures;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user