aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Zammit via Bug reports for the GNU Hurd <bug-hurd@gnu.org>2024-12-21 02:39:48 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2024-12-21 22:33:32 +0100
commit7b578f3794dbf1c9cde6bb92f1fc5799a287bd1a (patch)
tree3009722688db1adf97b653c26cc41ae3ea1a0f54
parent2409f1f69a5b2444990cb17f5a8d67eafb021740 (diff)
downloadgnumach-7b578f3794dbf1c9cde6bb92f1fc5799a287bd1a.tar.gz
gnumach-7b578f3794dbf1c9cde6bb92f1fc5799a287bd1a.tar.bz2
gnumach-7b578f3794dbf1c9cde6bb92f1fc5799a287bd1a.zip
acpi_parse_apic: Check CAPABLE bit field on lapic MADT flag
Previously, we were ignoring cpus that were not enabled but online-capable. Message-ID: <20241221023937.384420-1-damien@zamaudio.com>
-rw-r--r--i386/i386at/acpi_parse_apic.c2
-rw-r--r--i386/i386at/acpi_parse_apic.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/i386/i386at/acpi_parse_apic.c b/i386/i386at/acpi_parse_apic.c
index 24470426..ae92ee2e 100644
--- a/i386/i386at/acpi_parse_apic.c
+++ b/i386/i386at/acpi_parse_apic.c
@@ -376,7 +376,7 @@ static void
acpi_apic_add_lapic(struct acpi_apic_lapic *lapic_entry)
{
/* If cpu flag is correct */
- if (lapic_entry->flags & 0x1) {
+ if (lapic_entry->flags & (ACPI_LAPIC_FLAG_ENABLED | ACPI_LAPIC_FLAG_CAPABLE)) {
/* Add cpu to processors' list. */
apic_add_cpu(lapic_entry->apic_id);
}
diff --git a/i386/i386at/acpi_parse_apic.h b/i386/i386at/acpi_parse_apic.h
index 85e01170..df8d4bae 100644
--- a/i386/i386at/acpi_parse_apic.h
+++ b/i386/i386at/acpi_parse_apic.h
@@ -149,6 +149,8 @@ struct acpi_apic_lapic {
uint32_t flags;
} __attribute__((__packed__));
+#define ACPI_LAPIC_FLAG_ENABLED (1 << 0)
+#define ACPI_LAPIC_FLAG_CAPABLE (1 << 1)
/*
* I/O APIC Structure