You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

smbios.h 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef _SMBIOS_H
  2. #define _SMBIOS_H
  3. /** @file
  4. *
  5. * System Management BIOS
  6. */
  7. #include <stdint.h>
  8. /** An SMBIOS structure header */
  9. struct smbios_header {
  10. /** Type */
  11. uint8_t type;
  12. /** Length */
  13. uint8_t len;
  14. /** Handle */
  15. uint16_t handle;
  16. } __attribute__ (( packed ));
  17. /** SMBIOS structure descriptor */
  18. struct smbios_structure {
  19. /** Copy of SMBIOS structure header */
  20. struct smbios_header header;
  21. /** Offset of structure within SMBIOS */
  22. size_t offset;
  23. /** Length of strings section */
  24. size_t strings_len;
  25. };
  26. /** SMBIOS system information structure */
  27. struct smbios_system_information {
  28. /** SMBIOS structure header */
  29. struct smbios_header header;
  30. /** Manufacturer string */
  31. uint8_t manufacturer;
  32. /** Product string */
  33. uint8_t product;
  34. /** Version string */
  35. uint8_t version;
  36. /** Serial number string */
  37. uint8_t serial;
  38. /** UUID */
  39. uint8_t uuid[16];
  40. /** Wake-up type */
  41. uint8_t wakeup;
  42. } __attribute__ (( packed ));
  43. /** SMBIOS system information structure type */
  44. #define SMBIOS_TYPE_SYSTEM_INFORMATION 1
  45. extern int find_smbios_structure ( unsigned int type,
  46. struct smbios_structure *structure );
  47. extern int read_smbios_structure ( struct smbios_structure *structure,
  48. void *data, size_t len );
  49. extern int read_smbios_string ( struct smbios_structure *structure,
  50. unsigned int index,
  51. void *data, size_t len );
  52. #endif /* _SMBIOS_H */