acpi.hpp 709 B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include <types/path.hpp>
  3. #include <types/types.h>
  4. namespace kernel::hw::acpi {
  5. struct PACKED ACPI_table_header {
  6. char signature[4];
  7. uint32_t length;
  8. uint8_t revision;
  9. uint8_t checksum;
  10. uint8_t oemid[6];
  11. uint8_t oem_table_id[8];
  12. uint32_t oem_revision;
  13. uint32_t creator_id;
  14. uint32_t creator_revision;
  15. };
  16. struct PACKED MCFG {
  17. ACPI_table_header header;
  18. uint64_t : 64;
  19. struct MCFG_entry {
  20. uint64_t base_address;
  21. uint16_t segment_group;
  22. uint8_t start_bus;
  23. uint8_t end_bus;
  24. uint32_t : 32;
  25. } entries[];
  26. };
  27. int parse_acpi_tables();
  28. void* get_table(types::string_view name);
  29. } // namespace kernel::hw::acpi