Add support for Symmetric Multiprocessing (SMP) #26

Merged
harraiken merged 33 commits from smp into master 2026-05-18 18:44:54 +02:00
2 changed files with 2 additions and 18 deletions
Showing only changes of commit 9185ceade6 - Show all commits

View File

@@ -20,8 +20,7 @@ namespace MM
public:
STATIC XTAPI XTSTATUS AllocateKernelStack(OUT PVOID *Stack,
IN ULONG StackSize);
STATIC XTAPI XTSTATUS AllocateProcessorStructures(IN ULONG CpuNumber,
OUT PVOID *StructuresData);
STATIC XTAPI XTSTATUS AllocateProcessorStructures(OUT PVOID *StructuresData);
STATIC XTAPI VOID FreeKernelStack(IN PVOID Stack,
IN ULONG StackSize);
STATIC XTAPI VOID FreeProcessorStructures(IN PVOID StructuresData);

View File

@@ -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.
*
* @param CpuNumber
* Specifies the zero-indexed CPU number as an owner of the allocated structures.
*
* @param StructuresData
* Supplies a pointer to the memory area that will contain the allocated buffer.
*
@@ -107,12 +104,9 @@ MM::KernelPool::AllocateKernelStack(OUT PVOID *Stack,
*/
XTAPI
XTSTATUS
MM::KernelPool::AllocateProcessorStructures(IN ULONG CpuNumber,
OUT PVOID *StructuresData)
MM::KernelPool::AllocateProcessorStructures(OUT PVOID *StructuresData)
{
PKPROCESSOR_BLOCK ProcessorBlock;
PVOID ProcessorStructures;
UINT_PTR Address;
XTSTATUS Status;
/* Assign memory for processor structures */
@@ -126,15 +120,6 @@ MM::KernelPool::AllocateProcessorStructures(IN ULONG CpuNumber,
/* Make sure all structures are zeroed */
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 */
*StructuresData = ProcessorStructures;