Skip to content

Commit

Permalink
acpica: init FADT table and get boot flags
Browse files Browse the repository at this point in the history
Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
  • Loading branch information
wipawel committed Aug 30, 2021
1 parent 12c492e commit 5510bff
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions common/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,19 @@ static void madt_parser(ACPI_SUBTABLE_HEADER *entry, void *arg) {
}
}

static ACPI_STATUS init_fadt(void) {
ACPI_TABLE_FADT *fadt = acpi_find_table(ACPI_SIG_FADT);

if (!fadt)
return AE_ERROR;

boot_flags.legacy_devs = !!(fadt->BootFlags & ACPI_FADT_LEGACY_DEVICES);
boot_flags.i8042 = !!(fadt->BootFlags & ACPI_FADT_8042);
boot_flags.vga = !(fadt->BootFlags & ACPI_FADT_NO_VGA);

return AE_OK;
}

static ACPI_STATUS init_madt(unsigned bsp_cpu_id) {
ACPI_TABLE_MADT *madt = acpi_find_table(ACPI_SIG_MADT);
ACPI_SUBTABLE_HEADER *subtbl = (void *) madt + sizeof(*madt);
Expand Down Expand Up @@ -728,6 +741,10 @@ ACPI_STATUS init_acpi(unsigned bsp_cpu_id) {
if (status != AE_OK)
return status;

status = init_fadt();
if (status != AE_OK)
return status;

status = init_madt(bsp_cpu_id);
return status;
}
Expand Down

0 comments on commit 5510bff

Please sign in to comment.