Skip to content

Commit

Permalink
[HALX86] Implement ONECPU boot switch (reactos#6024)
Browse files Browse the repository at this point in the history
  • Loading branch information
HBelusca committed Nov 28, 2023
1 parent d834e28 commit e0592db
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hal/halx86/generic/halinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

/* GLOBALS *******************************************************************/

#ifdef CONFIG_SMP
BOOLEAN HalpOnlyBootProcessor;
#endif
BOOLEAN HalpPciLockSettings;

/* PRIVATE FUNCTIONS *********************************************************/
Expand All @@ -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;
Expand Down
7 changes: 7 additions & 0 deletions hal/halx86/smp/i386/spinup.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

/* GLOBALS *******************************************************************/

extern BOOLEAN HalpOnlyBootProcessor;

extern PPROCESSOR_IDENTITY HalpProcessorIdentity;
extern PHYSICAL_ADDRESS HalpLowStubPhysicalAddress;
extern PVOID HalpLowStub;
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit e0592db

Please sign in to comment.