Skip to content

Commit

Permalink
acpi: register ISA bus only when supported
Browse files Browse the repository at this point in the history
Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
  • Loading branch information
wipawel authored and bjoernd committed Aug 30, 2021
1 parent 3868874 commit d233de1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions common/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,18 +235,20 @@ static int process_fadt(void) {
static int process_madt_entries(unsigned bsp_cpu_id) {
acpi_madt_t *madt = (acpi_madt_t *) acpi_find_table(MADT_SIGNATURE);
acpi_madt_entry_t *entry;
bus_t *isa_bus;
bus_t *isa_bus = NULL;

if (!madt)
return -ENOENT;

printk("ACPI: [MADT] LAPIC Addr: %p, Flags: %08x\n", _ptr(madt->lapic_addr),
madt->flags);

isa_bus =
add_system_bus(ACPI_MADT_INT_BUS_ISA, madt_int_bus_names[ACPI_MADT_INT_BUS_ISA],
strlen(madt_int_bus_names[ACPI_MADT_INT_BUS_ISA]));
BUG_ON(!isa_bus);
if (boot_flags.legacy_devs) {
isa_bus = add_system_bus(ACPI_MADT_INT_BUS_ISA,
madt_int_bus_names[ACPI_MADT_INT_BUS_ISA],
strlen(madt_int_bus_names[ACPI_MADT_INT_BUS_ISA]));
BUG_ON(!isa_bus);
}

for (void *addr = madt->entry; addr < (_ptr(madt) + madt->header.length);
addr += entry->len) {
Expand Down

0 comments on commit d233de1

Please sign in to comment.