acpi.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* Minimal ACPI table discovery: RSDP -> RSDT/XSDT -> MADT.
  2. *
  3. * Only the CPU/LAPIC information needed to start APs is parsed. Absence of
  4. * ACPI or of a usable MADT is not an error: the kernel then stays UP.
  5. */
  6. #ifndef ACPI_H
  7. #define ACPI_H
  8. #define ACPI_MAX_CPUS 8
  9. #define ACPI_MAX_IOAPICS 4
  10. /* Returns 1 when a usable MADT with at least one local APIC entry was found.
  11. * acpi_cpu_count() then includes the BSP as entry 0. */
  12. int acpi_init(void);
  13. unsigned int acpi_cpu_count(void);
  14. unsigned int acpi_cpu_apic_id(unsigned int index);
  15. unsigned int acpi_bsp_apic_id(void);
  16. unsigned int acpi_lapic_base(void);
  17. unsigned int acpi_ioapic_count(void);
  18. unsigned int acpi_ioapic_base(unsigned int index);
  19. /* CMOS register holding the RTC century byte from the FADT, or 0 when the
  20. * firmware does not provide one (old non-ACPI hardware). */
  21. unsigned int acpi_rtc_century_reg(void);
  22. /* Put the machine into ACPI S5 (soft off). Returns 0 when the S5 write was
  23. * issued, -1 when the firmware provides no usable S5 path. */
  24. int acpi_poweroff(void);
  25. /* Reset through the FADT RESET_REG/RESET_VALUE. Returns 0 when the register
  26. * write was issued, -1 when the firmware provides no usable reset register. */
  27. int acpi_reset(void);
  28. /* Write the DSDT (as mapped at boot) to a VFS path, for diagnostics. */
  29. int acpi_dump_dsdt(const char *path);
  30. void acpi_dump(void);
  31. #endif