Skip to content

Commit

Permalink
Merge pull request #48 from gmbr3/compareguid
Browse files Browse the repository at this point in the history
Remove gnu-efi CompareGuid fixup
  • Loading branch information
pbatard authored Dec 11, 2024
2 parents 963f02b + e7e4c7b commit 2890f1b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
11 changes: 0 additions & 11 deletions boot.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,6 @@
#define P_ASSERT(f, l, a) if(!(a)) do { Print(L"*** ASSERT FAILED: %a(%d): %a ***\n", f, l, #a); while(1); } while(0)
#define V_ASSERT(a) P_ASSERT(__FILE__, __LINE__, a)

/*
* EDK2 and gnu-efi's CompareGuid() return opposite values for a match!
* EDK2 returns boolean TRUE, whereas gnu-efi returns INTN 0, so we
* define a common boolean macro that follows EDK2 convention always.
*/
#if defined(_GNU_EFI)
#define COMPARE_GUID(a, b) (CompareGuid(a, b) == 0)
#else
#define COMPARE_GUID CompareGuid
#endif

/*
* Secure string length, that asserts if the string is NULL or if
* the length is larger than a predetermined value (STRING_MAX)
Expand Down
2 changes: 1 addition & 1 deletion system.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static EFI_STATUS GetSystemConfigurationTable(EFI_GUID* TableGuid, VOID** Table)
V_ASSERT(Table != NULL);

for (Index = 0; Index < gST->NumberOfTableEntries; Index++) {
if (COMPARE_GUID(TableGuid, &(gST->ConfigurationTable[Index].VendorGuid))) {
if (CompareGuid(TableGuid, &(gST->ConfigurationTable[Index].VendorGuid))) {
*Table = gST->ConfigurationTable[Index].VendorTable;
return EFI_SUCCESS;
}
Expand Down

0 comments on commit 2890f1b

Please sign in to comment.