Make CompareGuid match EDK2 ABI

* return BOOLEAN instead of INTN
* Use EFIAPI
* Opposite return codes

Signed-off-by: Callum Farmer <gmbr3@opensuse.org>
This commit is contained in:
Callum Farmer 2024-07-28 15:59:14 +01:00
parent 13c46e46a6
commit a093fe0378
No known key found for this signature in database
GPG Key ID: 9A5B19E18CD0013C
5 changed files with 58 additions and 16 deletions

View File

@ -495,10 +495,11 @@ ReleaseLock (
);
INTN
CompareGuid(
IN EFI_GUID *Guid1,
IN EFI_GUID *Guid2
BOOLEAN
EFIAPI
CompareGuid_1 (
IN CONST EFI_GUID *Guid1,
IN CONST EFI_GUID *Guid2
);
VOID *

View File

@ -151,11 +151,12 @@ RtStrSize (
IN CONST CHAR16 *s1
);
INTN
BOOLEAN
EFIAPI
RUNTIMEFUNCTION
RtCompareGuid (
IN EFI_GUID *Guid1,
IN EFI_GUID *Guid2
IN CONST EFI_GUID *Guid1,
IN CONST EFI_GUID *Guid2
);
UINT8

View File

@ -57,5 +57,39 @@ ReallocatePool_0 (
/* end CopyMem */
/* CompareGuid */
#ifndef GNU_EFI_USE_COMPAREGUID_ABI
#define GNU_EFI_USE_COMPAREGUID_ABI 1
#endif
#if GNU_EFI_USE_COMPAREGUID_ABI == 0
#define CompareGuid CompareGuid_0
#else
#define CompareGuid CompareGuid_1
#endif
/* prevent circular headers */
BOOLEAN
EFIAPI
CompareGuid_1 (
IN CONST EFI_GUID *Guid1,
IN CONST EFI_GUID *Guid2
);
static
inline
INTN
EFIAPI
CompareGuid_0 (
IN EFI_GUID *Guid1,
IN EFI_GUID *Guid2)
{
if (CompareGuid_1(Guid1, Guid2)) {
return 0;
} else {
return 1;
}
}
#endif

View File

@ -114,10 +114,11 @@ InitializeGuid (
{
}
INTN
CompareGuid(
IN EFI_GUID *Guid1,
IN EFI_GUID *Guid2
BOOLEAN
EFIAPI
CompareGuid_1 (
IN CONST EFI_GUID *Guid1,
IN CONST EFI_GUID *Guid2
)
/*++

View File

@ -134,11 +134,12 @@ RtCompareMem (
#ifndef __GNUC__
#pragma RUNTIME_CODE(RtCompareGuid)
#endif
INTN
BOOLEAN
EFIAPI
RUNTIMEFUNCTION
RtCompareGuid (
IN EFI_GUID *Guid1,
IN EFI_GUID *Guid2
IN CONST EFI_GUID *Guid1,
IN CONST EFI_GUID *Guid2
)
/*++
@ -152,7 +153,7 @@ Arguments:
Guid2 - guid to compare
Returns:
= 0 if Guid1 == Guid2
= 1 if Guid1 == Guid2
--*/
{
@ -170,7 +171,11 @@ Returns:
r |= g1[2] - g2[2];
r |= g1[3] - g2[3];
return r;
if (r==0) {
return 1;
} else {
return 0;
}
}