smbios.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * GRUB -- GRand Unified Bootloader
  3. * Copyright (C) 2019 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_SMBIOS_HEADER
  19. #define GRUB_SMBIOS_HEADER 1
  20. #include <grub/symbol.h>
  21. #include <grub/types.h>
  22. #define GRUB_SMBIOS_TYPE_END_OF_TABLE ((grub_uint8_t)127)
  23. struct grub_smbios_ieps
  24. {
  25. grub_uint8_t anchor[5]; /* "_DMI_" */
  26. grub_uint8_t checksum;
  27. grub_uint16_t table_length;
  28. grub_uint32_t table_address;
  29. grub_uint16_t structures;
  30. grub_uint8_t revision;
  31. } GRUB_PACKED;
  32. struct grub_smbios_eps
  33. {
  34. grub_uint8_t anchor[4]; /* "_SM_" */
  35. grub_uint8_t checksum;
  36. grub_uint8_t length; /* 0x1f */
  37. grub_uint8_t version_major;
  38. grub_uint8_t version_minor;
  39. grub_uint16_t maximum_structure_size;
  40. grub_uint8_t revision;
  41. grub_uint8_t formatted[5];
  42. struct grub_smbios_ieps intermediate;
  43. } GRUB_PACKED;
  44. struct grub_smbios_eps3
  45. {
  46. grub_uint8_t anchor[5]; /* "_SM3_" */
  47. grub_uint8_t checksum;
  48. grub_uint8_t length; /* 0x18 */
  49. grub_uint8_t version_major;
  50. grub_uint8_t version_minor;
  51. grub_uint8_t docrev;
  52. grub_uint8_t revision;
  53. grub_uint8_t reserved;
  54. grub_uint32_t maximum_table_length;
  55. grub_uint64_t table_address;
  56. } GRUB_PACKED;
  57. extern struct grub_smbios_eps *grub_machine_smbios_get_eps (void);
  58. extern struct grub_smbios_eps3 *grub_machine_smbios_get_eps3 (void);
  59. extern struct grub_smbios_eps *EXPORT_FUNC (grub_smbios_get_eps) (void);
  60. #endif /* ! GRUB_SMBIOS_HEADER */