CloudHv.c 859 B

123456789101112131415161718192021222324252627282930313233
  1. /** @file
  2. Find Cloud Hypervisor SMBIOS data.
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. **/
  5. #include <IndustryStandard/CloudHv.h> // CLOUDHV_SMBIOS_ADDRESS
  6. #include <IndustryStandard/SmBios.h> // SMBIOS_TABLE_3_0_ENTRY_POINT
  7. /**
  8. Locates and extracts Cloud Hypervisor SMBIOS data
  9. @return Address of extracted Cloud Hypervisor SMBIOS data
  10. **/
  11. UINT8 *
  12. GetCloudHvSmbiosTables (
  13. VOID
  14. )
  15. {
  16. SMBIOS_TABLE_3_0_ENTRY_POINT *CloudHvTables = (VOID *)CLOUDHV_SMBIOS_ADDRESS;
  17. if ((CloudHvTables->AnchorString[0] == '_') &&
  18. (CloudHvTables->AnchorString[1] == 'S') &&
  19. (CloudHvTables->AnchorString[2] == 'M') &&
  20. (CloudHvTables->AnchorString[3] == '3') &&
  21. (CloudHvTables->AnchorString[4] == '_'))
  22. {
  23. return (UINT8 *)(UINTN)CloudHvTables->TableAddress;
  24. }
  25. return NULL;
  26. }