summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2026-03-30 08:57:42 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2026-03-30 08:58:08 +0200
commit5dbeca342145cfc8e1ad852291dea44dd58f1d1d (patch)
tree74c3af331d9a9a1656c0f62b93ddcea74692fb99
parent3d3eaee45360aa3945da1d7c8b3eea0474868269 (diff)
[FEAT] boot: Add `prop/smp_max` property in BootZ.HEADdevelop
brief: The feature introduces how many cores are allowed to be used by NeKernel. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
-rw-r--r--src/boot/src/HEL/AMD64/BootEFI.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/boot/src/HEL/AMD64/BootEFI.cpp b/src/boot/src/HEL/AMD64/BootEFI.cpp
index d552e325..d3492843 100644
--- a/src/boot/src/HEL/AMD64/BootEFI.cpp
+++ b/src/boot/src/HEL/AMD64/BootEFI.cpp
@@ -217,6 +217,17 @@ EFI_EXTERN_C EFI_API Int32 BootloaderMain(EfiHandlePtr image_handle, EfiSystemTa
ST->RuntimeServices->GetVariable(L"/props/kern_ver", kEfiGlobalNamespaceVarGUID, nullptr, &sz_ver,
&ver);
+ UInt32 sz_smp_max = sizeof(UInt64);
+ UInt64 smp_max = 0;
+
+ ST->RuntimeServices->GetVariable(L"/props/smp_max", kEfiGlobalNamespaceVarGUID, nullptr,
+ &sz_smp_max, &smp_max);
+
+ /// This variable makes sure we enable the core we want to actually use.
+ if (smp_max > 0 && smp_max < kHandoverHeader->f_NumberOfProcessors) {
+ kHandoverHeader->f_NumberOfProcessors = smp_max;
+ }
+
if (ver < KERNEL_VERSION_BCD) {
ver = KERNEL_VERSION_BCD;