diff --git a/hal/halx86/generic/halinit.c b/hal/halx86/generic/halinit.c index 62213f244531d..bffeb933c79cc 100644 --- a/hal/halx86/generic/halinit.c +++ b/hal/halx86/generic/halinit.c @@ -14,6 +14,9 @@ /* GLOBALS *******************************************************************/ +#ifdef CONFIG_SMP +BOOLEAN HalpOnlyBootProcessor; +#endif BOOLEAN HalpPciLockSettings; /* PRIVATE FUNCTIONS *********************************************************/ @@ -30,6 +33,12 @@ HalpGetParameters( /* Read the command line */ PCSTR CommandLine = LoaderBlock->LoadOptions; +#ifdef CONFIG_SMP + /* Check whether we should only start one CPU */ + if (strstr(CommandLine, "ONECPU")) + HalpOnlyBootProcessor = TRUE; +#endif + /* Check if PCI is locked */ if (strstr(CommandLine, "PCILOCK")) HalpPciLockSettings = TRUE; diff --git a/hal/halx86/smp/i386/spinup.c b/hal/halx86/smp/i386/spinup.c index 12fbea168cb35..359cc30d657d0 100644 --- a/hal/halx86/smp/i386/spinup.c +++ b/hal/halx86/smp/i386/spinup.c @@ -16,6 +16,8 @@ /* GLOBALS *******************************************************************/ +extern BOOLEAN HalpOnlyBootProcessor; + extern PPROCESSOR_IDENTITY HalpProcessorIdentity; extern PHYSICAL_ADDRESS HalpLowStubPhysicalAddress; extern PVOID HalpLowStub; @@ -88,6 +90,11 @@ HalStartNextProcessor( _In_ PLOADER_PARAMETER_BLOCK LoaderBlock, _In_ PKPROCESSOR_STATE ProcessorState) { + /* Bail out if we only use the boot CPU */ + if (HalpOnlyBootProcessor) + return FALSE; + + /* Bail out if we have started all available CPUs */ if (HalpStartedProcessorCount == HalpApicInfoTable.ProcessorCount) return FALSE;