bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/5 gnumach] i386/apic: Fix logical id numbering


From: Damien Zammit
Subject: [PATCH 1/5 gnumach] i386/apic: Fix logical id numbering
Date: Tue, 10 Dec 2024 07:29:43 +0000

The number is actually a mask bit per cpu.
---
 i386/i386/apic.c | 2 +-
 i386/i386/apic.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/i386/i386/apic.c b/i386/i386/apic.c
index 7ec8c49b..e0941c6a 100644
--- a/i386/i386/apic.c
+++ b/i386/i386/apic.c
@@ -337,7 +337,7 @@ lapic_setup(void)
 
     /* Every 8th cpu is in the same logical group */
     dummy = lapic->logical_dest.r;
-    lapic->logical_dest.r = 0x01000000 << (APIC_LOGICAL_ID(cpu));
+    lapic->logical_dest.r = APIC_LOGICAL_ID(cpu) << 24;
 
     dummy = lapic->lvt_lint0.r;
     lapic->lvt_lint0.r = dummy | LAPIC_DISABLE;
diff --git a/i386/i386/apic.h b/i386/i386/apic.h
index ec910456..cb700c44 100644
--- a/i386/i386/apic.h
+++ b/i386/i386/apic.h
@@ -314,7 +314,7 @@ extern uint32_t *hpet_addr;
 
 /* Since Logical Destination Register only has 8 bits of mask,
  * we can only address 8 unique groups of cpus for IPIs.  */
-#define APIC_LOGICAL_ID(cpu)             ((cpu) % 8)
+#define APIC_LOGICAL_ID(cpu)             (1u << ((cpu) % 8))
 
 /* Set or clear a bit in a 255-bit APIC mask register.
    These registers are spread through eight 32-bit registers.  */
-- 
2.45.2





reply via email to

[Prev in Thread] Current Thread [Next in Thread]