acpi.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * GRUB -- GRand Unified Bootloader
  3. * Copyright (C) 2009 Free Software Foundation, Inc.
  4. *
  5. * GRUB is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * GRUB is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef GRUB_ACPI_HEADER
  19. #define GRUB_ACPI_HEADER 1
  20. #include <grub/types.h>
  21. #include <grub/err.h>
  22. struct grub_acpi_rsdp_v10
  23. {
  24. grub_uint8_t signature[8];
  25. grub_uint8_t checksum;
  26. grub_uint8_t oemid[6];
  27. grub_uint8_t revision;
  28. grub_uint32_t rsdt_addr;
  29. } __attribute__ ((packed));
  30. struct grub_acpi_rsdp_v20
  31. {
  32. struct grub_acpi_rsdp_v10 rsdpv1;
  33. grub_uint32_t length;
  34. grub_uint64_t xsdt_addr;
  35. grub_uint8_t checksum;
  36. grub_uint8_t reserved[3];
  37. } __attribute__ ((packed));
  38. struct grub_acpi_table_header
  39. {
  40. grub_uint8_t signature[4];
  41. grub_uint32_t length;
  42. grub_uint8_t revision;
  43. grub_uint8_t checksum;
  44. grub_uint8_t oemid[6];
  45. grub_uint8_t oemtable[8];
  46. grub_uint32_t oemrev;
  47. grub_uint8_t creator_id[4];
  48. grub_uint32_t creator_rev;
  49. } __attribute__ ((packed));
  50. struct grub_acpi_fadt
  51. {
  52. struct grub_acpi_table_header hdr;
  53. grub_uint32_t facs_addr;
  54. grub_uint32_t dsdt_addr;
  55. grub_uint8_t somefields1[88];
  56. grub_uint64_t facs_xaddr;
  57. grub_uint64_t dsdt_xaddr;
  58. grub_uint8_t somefields2[96];
  59. } __attribute__ ((packed));
  60. struct grub_acpi_rsdp_v10 *grub_acpi_get_rsdpv1 (void);
  61. struct grub_acpi_rsdp_v20 *grub_acpi_get_rsdpv2 (void);
  62. struct grub_acpi_rsdp_v10 *grub_machine_acpi_get_rsdpv1 (void);
  63. struct grub_acpi_rsdp_v20 *grub_machine_acpi_get_rsdpv2 (void);
  64. grub_uint8_t grub_byte_checksum (void *base, grub_size_t size);
  65. grub_err_t grub_acpi_create_ebda (void);
  66. #endif /* ! GRUB_ACPI_HEADER */