Use EDK2 compatible names for SMBIOS and AsciiStr functions and GUIDs

This commit is contained in:
Pete Batard 2023-11-17 13:29:37 +00:00
parent bfaaec428b
commit ac8d6944c2
4 changed files with 31 additions and 16 deletions

View File

@ -158,8 +158,10 @@ extern EFI_GUID EfiPartTypeLegacyMbrGuid;
extern EFI_GUID MpsTableGuid;
extern EFI_GUID AcpiTableGuid;
extern EFI_GUID SMBIOSTableGuid;
extern EFI_GUID SMBIOS3TableGuid;
extern EFI_GUID gEfiSmbiosTableGuid;
#define SMBIOSTableGuid gEfiSmbiosTableGuid
extern EFI_GUID gEfiSmbios3TableGuid;
#define SMBIOSTableGuid gEfiSmbiosTableGuid
extern EFI_GUID SalSystemTableGuid;
extern EFI_GUID EfiDtbTableGuid;
@ -398,23 +400,30 @@ StrDuplicate (
);
UINTN
strlena (
AsciiStrLen (
IN CONST CHAR8 *s1
);
UINTN
strcmpa (
AsciiStrCmp (
IN CONST CHAR8 *s1,
IN CONST CHAR8 *s2
);
UINTN
strncmpa (
AsciiStrnCmp (
IN CONST CHAR8 *s1,
IN CONST CHAR8 *s2,
IN UINTN len
IN UINTN len
);
//
// For compatibility with previous gnu-efi versions
//
#define strlena AsciiStrLen
#define strcmpa AsciiStrCmp
#define strncmpa AsciiStrnCmp
UINTN
xtoi (
CONST CHAR16 *str

View File

@ -35,7 +35,9 @@ typedef struct {
UINT32 TableAddress;
UINT16 NumberOfSmbiosStructures;
UINT8 SmbiosBcdRevision;
} SMBIOS_STRUCTURE_TABLE;
} SMBIOS_TABLE_ENTRY_POINT;
#define SMBIOS_STRUCTURE_TABLE SMBIOS_TABLE_ENTRY_POINT
typedef struct {
UINT8 AnchorString[5];
@ -48,18 +50,22 @@ typedef struct {
UINT8 Reserved;
UINT32 TableMaximumSize;
UINT64 TableAddress;
} SMBIOS3_STRUCTURE_TABLE;
} SMBIOS_TABLE_3_0_ENTRY_POINT;
#define SMBIOS3_STRUCTURE_TABLE SMBIOS_TABLE_3_0_ENTRY_POINT
//
// Please note that SMBIOS structures can be odd byte aligned since the
// unformated section of each record is a set of arbitrary size strings.
// unformated section of each record is a set of arbitrary size strings.
//
typedef struct {
UINT8 Type;
UINT8 Length;
UINT8 Handle[2];
} SMBIOS_HEADER;
} SMBIOS_STRUCTURE;
#define SMBIOS_HEADER SMBIOS_STRUCTURE
typedef UINT8 SMBIOS_STRING;

View File

@ -178,8 +178,8 @@ EFI_GUID UnknownDevice = UNKNOWN_DEVICE_GUID;
EFI_GUID MpsTableGuid = MPS_TABLE_GUID;
EFI_GUID AcpiTableGuid = ACPI_TABLE_GUID;
EFI_GUID SMBIOSTableGuid = SMBIOS_TABLE_GUID;
EFI_GUID SMBIOS3TableGuid = SMBIOS3_TABLE_GUID;
EFI_GUID gEfiSmbiosTableGuid = SMBIOS_TABLE_GUID;
EFI_GUID gEfiSmbios3TableGuid = SMBIOS3_TABLE_GUID;
EFI_GUID SalSystemTableGuid = SAL_SYSTEM_TABLE_GUID;
EFI_GUID EfiDtbTableGuid = EFI_DTB_TABLE_GUID;

View File

@ -213,7 +213,7 @@ StrDuplicate (
}
UINTN
strlena (
AsciiStrLen (
IN CONST CHAR8 *s1
)
// string length
@ -225,7 +225,7 @@ strlena (
}
UINTN
strcmpa (
AsciiStrCmp (
IN CONST CHAR8 *s1,
IN CONST CHAR8 *s2
)
@ -244,10 +244,10 @@ strcmpa (
}
UINTN
strncmpa (
AsciiStrnCmp (
IN CONST CHAR8 *s1,
IN CONST CHAR8 *s2,
IN UINTN len
IN UINTN len
)
// compare strings
{