Replace hardcoded stack count with architecture specific constant
All checks were successful
Builds / ExectOS (amd64, debug) (push) Successful in 41s
Builds / ExectOS (amd64, release) (push) Successful in 40s
Builds / ExectOS (i686, release) (push) Successful in 36s
Builds / ExectOS (i686, debug) (push) Successful in 37s

This commit is contained in:
2026-03-28 20:53:50 +01:00
parent a608b26fde
commit e9aaeab982
3 changed files with 5 additions and 1 deletions

View File

@@ -111,6 +111,7 @@
/* XTOS Kernel stack size */ /* XTOS Kernel stack size */
#define KERNEL_STACK_SIZE 0x8000 #define KERNEL_STACK_SIZE 0x8000
#define KERNEL_STACKS 3
/* XTOS Kernel stack guard pages */ /* XTOS Kernel stack guard pages */
#define KERNEL_STACK_GUARD_PAGES 1 #define KERNEL_STACK_GUARD_PAGES 1

View File

@@ -130,6 +130,7 @@
/* XTOS Kernel stack size */ /* XTOS Kernel stack size */
#define KERNEL_STACK_SIZE 0x4000 #define KERNEL_STACK_SIZE 0x4000
#define KERNEL_STACKS 2
/* XTOS Kernel stack guard pages */ /* XTOS Kernel stack guard pages */
#define KERNEL_STACK_GUARD_PAGES 1 #define KERNEL_STACK_GUARD_PAGES 1

View File

@@ -128,7 +128,9 @@ MM::KernelPool::AllocateProcessorStructures(IN ULONG CpuNumber,
/* Align address to page size boundary and find a space for processor block */ /* Align address to page size boundary and find a space for processor block */
Address = ROUND_UP((UINT_PTR)ProcessorStructures, MM_PAGE_SIZE); Address = ROUND_UP((UINT_PTR)ProcessorStructures, MM_PAGE_SIZE);
ProcessorBlock = (PKPROCESSOR_BLOCK)((PUCHAR)Address + (2 * KERNEL_STACK_SIZE) + (GDT_ENTRIES * sizeof(KGDTENTRY))); ProcessorBlock = (PKPROCESSOR_BLOCK)((PUCHAR)Address +
(KERNEL_STACKS * KERNEL_STACK_SIZE) +
(GDT_ENTRIES * sizeof(KGDTENTRY)));
/* Store processor number in the processor block */ /* Store processor number in the processor block */
ProcessorBlock->CpuNumber = CpuNumber; ProcessorBlock->CpuNumber = CpuNumber;