|
ginnOS
The reference: libc, the libraries and the kernel
|
the ACPI tables: RSDP, RSDT/XSDT, MADT, FADT, HPET and MCFG. More...
Go to the source code of this file.
Data Structures | |
| struct | acpi_ioapic_t |
| one I/O APIC from the MADT. More... | |
| struct | acpi_iso_t |
| an interrupt source override from the MADT: ISA IRQ source is global system interrupt gsi, with the given polarity and trigger mode. More... | |
| struct | acpi_info_t |
| what the kernel takes from the ACPI tables. More... | |
Macros | |
| #define | ACPI_MAX_CPUS 64 |
| #define | ACPI_MAX_IOAPICS 4 |
| #define | ACPI_MAX_ISOS 16 |
Functions | |
| bool | acpi_init (const boot_info_t *boot) |
| find and read the tables. | |
| const acpi_info_t * | acpi_info (void) |
| what acpi_init found (present is false if it found nothing). | |
| uint32_t | acpi_irq_to_gsi (uint8_t irq, bool *active_low, bool *level) |
| the global system interrupt of a legacy ISA IRQ, after the MADT overrides (for example IRQ 0 is often GSI 2). | |
| void | acpi_reboot (void) __attribute__((noreturn)) |
| restart the machine: the FADT reset register, then the keyboard controller, then a triple fault. | |
| void | acpi_power_off (void) __attribute__((noreturn)) |
| turn the machine off: the ACPI S5 state (the _S5 sleep types into the PM1 control registers), then the QEMU and Bochs ports. | |
| bool | acpi_find_s5 (const uint8_t *aml, uint32_t length, uint8_t *type_a, uint8_t *type_b) |
| find the S5 sleep types in DSDT bytes (the AML of "Name (_S5, Package
() {a, b, ...})"), without an AML interpreter. | |
the ACPI tables: RSDP, RSDT/XSDT, MADT, FADT, HPET and MCFG.
the kernel reads the static tables only. it has no AML interpreter, so it cannot run the DSDT: no device enumeration through ACPI. power-off reads only the _S5 package from the DSDT bytes. reboot uses the FADT reset register.
| #define ACPI_MAX_CPUS 64 |
| #define ACPI_MAX_IOAPICS 4 |
| #define ACPI_MAX_ISOS 16 |
| bool acpi_init | ( | const boot_info_t * | boot | ) |
find and read the tables.
the RSDP comes from the bootloader if it gave one, else from a scan of the BIOS areas. call after mmio_init.
| boot | the boot information (rsdp, rsdp_size). |
| const acpi_info_t * acpi_info | ( | void | ) |
what acpi_init found (present is false if it found nothing).
the global system interrupt of a legacy ISA IRQ, after the MADT overrides (for example IRQ 0 is often GSI 2).
| irq | an ISA IRQ, 0 to 15. |
| active_low | receives the polarity (may be NULL). |
| level | receives the trigger mode (may be NULL). |
| void acpi_reboot | ( | void | ) |
restart the machine: the FADT reset register, then the keyboard controller, then a triple fault.
does not return.
| void acpi_power_off | ( | void | ) |
turn the machine off: the ACPI S5 state (the _S5 sleep types into the PM1 control registers), then the QEMU and Bochs ports.
if all fail, the CPU halts.