https://git.reactos.org/?p=reactos.git;a=commitdiff;h=10bb50b45673f5e7d9318cf40eda4cef5b9f2fbf

commit 10bb50b45673f5e7d9318cf40eda4cef5b9f2fbf
Author:     Timo Kreuzer <timo.kreu...@reactos.org>
AuthorDate: Thu Nov 23 22:20:51 2023 +0200
Commit:     Timo Kreuzer <timo.kreu...@reactos.org>
CommitDate: Sat Dec 30 12:53:18 2023 +0200

    [HAL] Fix SMP initialization
    
    - Don't use CONFIG_SMP, this isn't handled in (most of) hal
    - Add a dummy HalpSetupProcessorsTable for UP
    - Call HalpRegisterKdSupportFunctions only for processor 0
---
 hal/halx86/apic/halinit.c    | 4 ----
 hal/halx86/generic/halinit.c | 7 +++++--
 hal/halx86/generic/up.c      | 7 +++++++
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/hal/halx86/apic/halinit.c b/hal/halx86/apic/halinit.c
index 907f0cfd28f..7658f3d5074 100644
--- a/hal/halx86/apic/halinit.c
+++ b/hal/halx86/apic/halinit.c
@@ -25,16 +25,12 @@ HalpInitProcessor(
     IN ULONG ProcessorNumber,
     IN PLOADER_PARAMETER_BLOCK LoaderBlock)
 {
-#ifdef CONFIG_SMP
     if (ProcessorNumber == 0)
     {
-#endif
         HalpParseApicTables(LoaderBlock);
-#ifdef CONFIG_SMP
     }
 
     HalpSetupProcessorsTable(ProcessorNumber);
-#endif
 
     /* Initialize the local APIC for this cpu */
     ApicInitializeLocalApic(ProcessorNumber);
diff --git a/hal/halx86/generic/halinit.c b/hal/halx86/generic/halinit.c
index 70822fd5cc5..be32ed7644d 100644
--- a/hal/halx86/generic/halinit.c
+++ b/hal/halx86/generic/halinit.c
@@ -57,8 +57,11 @@ HalInitializeProcessor(
     InterlockedBitTestAndSetAffinity(&HalpActiveProcessors, ProcessorNumber);
     InterlockedBitTestAndSetAffinity(&HalpDefaultInterruptAffinity, 
ProcessorNumber);
 
-    /* Register routines for KDCOM */
-    HalpRegisterKdSupportFunctions();
+    if (ProcessorNumber == 0)
+    {
+        /* Register routines for KDCOM */
+        HalpRegisterKdSupportFunctions();
+    }
 }
 
 /*
diff --git a/hal/halx86/generic/up.c b/hal/halx86/generic/up.c
index 377c7e1aaf5..9e42e6f786b 100644
--- a/hal/halx86/generic/up.c
+++ b/hal/halx86/generic/up.c
@@ -33,6 +33,13 @@ HalStartNextProcessor(
     return FALSE;
 }
 
+VOID
+HalpSetupProcessorsTable(
+    _In_ UINT32 NTProcessorNumber)
+{
+    NOTHING;
+}
+
 #ifdef _M_AMD64
 
 VOID

Reply via email to