Implement AcGetSMBiosTable() and AcGetSMBios3Table() routines
This commit is contained in:
parent
4fa5b8f2a5
commit
1828acbc56
@ -142,6 +142,7 @@ typedef struct _CPPORT
|
||||
USHORT Flags;
|
||||
} CPPORT, *PCPPORT;
|
||||
|
||||
/* HAL framebuffer data structure */
|
||||
typedef struct _HAL_FRAMEBUFFER_DATA
|
||||
{
|
||||
BOOLEAN Initialized;
|
||||
@ -154,4 +155,38 @@ typedef struct _HAL_FRAMEBUFFER_DATA
|
||||
UINT Pitch;
|
||||
} HAL_FRAMEBUFFER_DATA, *PHAL_FRAMEBUFFER_DATA;
|
||||
|
||||
/* SMBIOS table header structure */
|
||||
typedef struct _SMBIOS_TABLE_HEADER
|
||||
{
|
||||
UCHAR Signature[4];
|
||||
UCHAR Checksum;
|
||||
UCHAR Length;
|
||||
UCHAR MajorVersion;
|
||||
UCHAR MinorVersion;
|
||||
USHORT MaxStructureSize;
|
||||
UCHAR EntryPointRevision;
|
||||
UCHAR Reserved[5];
|
||||
UCHAR Signature2[5];
|
||||
UCHAR IntermediateChecksum;
|
||||
USHORT TableLength;
|
||||
ULONG TableAddress;
|
||||
USHORT NumberOfStructures;
|
||||
UCHAR BcdRevision;
|
||||
} SMBIOS_TABLE_HEADER, *PSMBIOS_TABLE_HEADER;
|
||||
|
||||
/* SMBIOS3 table header structure */
|
||||
typedef struct _SMBIOS3_TABLE_HEADER
|
||||
{
|
||||
UCHAR Signature[5];
|
||||
UCHAR Checksum;
|
||||
UCHAR Length;
|
||||
UCHAR MajorVersion;
|
||||
UCHAR MinorVersion;
|
||||
UCHAR DocRevision;
|
||||
UCHAR EntryPointRevision;
|
||||
UCHAR Reserved;
|
||||
ULONG MaxStructureSize;
|
||||
ULONGLONG TableAddress;
|
||||
} SMBIOS3_TABLE_HEADER, *PSMBIOS3_TABLE_HEADER;
|
||||
|
||||
#endif /* __XTDK_HLTYPES_H */
|
||||
|
@ -119,6 +119,70 @@ AcGetRsdpTable(OUT PVOID *AcpiTable)
|
||||
return STATUS_EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets SMBIOS from EFI system configuration
|
||||
*
|
||||
* @param SmBiosTable
|
||||
* Suplies a pointer to memory area where SMBIOS address will be stored.
|
||||
*
|
||||
* @return This routine returns a status code.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
AcGetSMBiosTable(OUT PVOID *SmBiosTable)
|
||||
{
|
||||
EFI_GUID SmBiosGuid = EFI_CONFIG_TABLE_SMBIOS_TABLE_GUID;
|
||||
PSMBIOS_TABLE_HEADER SmBios;
|
||||
EFI_STATUS Status;
|
||||
|
||||
/* Get SMBIOS table from system configuration tables */
|
||||
Status = XtLdrProtocol->Util.GetConfigurationTable(&SmBiosGuid, (PVOID)&SmBios);
|
||||
if(Status != STATUS_EFI_SUCCESS || AcpChecksumTable(SmBios, SmBios->Length) != 0)
|
||||
{
|
||||
/* SMBIOS not found or checksum mismatch */
|
||||
*SmBiosTable = NULL;
|
||||
return STATUS_EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
/* SMBIOS found, return success */
|
||||
*SmBiosTable = SmBios;
|
||||
return STATUS_EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets SMBIOS3 from EFI system configuration
|
||||
*
|
||||
* @param SmBiosTable
|
||||
* Suplies a pointer to memory area where SMBIOS3 address will be stored.
|
||||
*
|
||||
* @return This routine returns a status code.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
AcGetSMBios3Table(OUT PVOID *SmBiosTable)
|
||||
{
|
||||
EFI_GUID SmBios3Guid = EFI_CONFIG_TABLE_SMBIOS3_TABLE_GUID;
|
||||
PSMBIOS3_TABLE_HEADER SmBios;
|
||||
EFI_STATUS Status;
|
||||
|
||||
/* Get SMBIOS3 table from system configuration tables */
|
||||
Status = XtLdrProtocol->Util.GetConfigurationTable(&SmBios3Guid, (PVOID)&SmBios);
|
||||
if(Status != STATUS_EFI_SUCCESS || AcpChecksumTable(SmBios, SmBios->Length) != 0)
|
||||
{
|
||||
/* SMBIOS3 not found or checksum mismatch */
|
||||
*SmBiosTable = NULL;
|
||||
return STATUS_EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
/* SMBIOS3 found, return success */
|
||||
*SmBiosTable = SmBios;
|
||||
return STATUS_EFI_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets XSDP (ACPI 2.0) from EFI system configuration
|
||||
*
|
||||
|
@ -26,6 +26,14 @@ XTCDECL
|
||||
EFI_STATUS
|
||||
AcGetRsdpTable(OUT PVOID *AcpiTable);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
AcGetSMBiosTable(OUT PVOID *SmBiosTable);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
AcGetSMBios3Table(OUT PVOID *SmBiosTable);
|
||||
|
||||
XTCDECL
|
||||
EFI_STATUS
|
||||
AcGetXsdpTable(OUT PVOID *AcpiTable);
|
||||
|
Loading…
Reference in New Issue
Block a user