[efi] Use standard va_args macros instead of VA_START() etc

The EDK2 header macros VA_START(), VA_ARG() etc produce build errors
on some CPU architectures (notably on 32-bit RISC-V, which is not yet
supported by EDK2).

Fix by using the standard variable argument list macros.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
pull/1307/head
Michael Brown 2024-09-15 02:01:46 +01:00
parent 1d43e535fb
commit 670810bed8
1 changed files with 12 additions and 12 deletions

View File

@ -1059,7 +1059,7 @@ efi_install_multiple_protocol_interfaces_wrapper ( EFI_HANDLE *handle, ... ) {
void *retaddr = __builtin_return_address ( 0 );
EFI_GUID *protocol[ MAX_WRAP_MULTI + 1 ];
VOID *interface[MAX_WRAP_MULTI];
VA_LIST ap;
va_list ap;
unsigned int i;
EFI_STATUS efirc;
@ -1067,20 +1067,20 @@ efi_install_multiple_protocol_interfaces_wrapper ( EFI_HANDLE *handle, ... ) {
efi_handle_name ( *handle ) );
memset ( protocol, 0, sizeof ( protocol ) );
memset ( interface, 0, sizeof ( interface ) );
VA_START ( ap, handle );
for ( i = 0 ; ( protocol[i] = VA_ARG ( ap, EFI_GUID * ) ) ; i++ ) {
va_start ( ap, handle );
for ( i = 0 ; ( protocol[i] = va_arg ( ap, EFI_GUID * ) ) ; i++ ) {
if ( i == MAX_WRAP_MULTI ) {
VA_END ( ap );
va_end ( ap );
efirc = EFI_OUT_OF_RESOURCES;
DBGC ( colour, "<FATAL: too many arguments> ) = %s "
"-> %p\n", efi_status ( efirc ), retaddr );
return efirc;
}
interface[i] = VA_ARG ( ap, VOID * );
interface[i] = va_arg ( ap, VOID * );
DBGC ( colour, ", %s, %p",
efi_guid_ntoa ( protocol[i] ), interface[i] );
}
VA_END ( ap );
va_end ( ap );
DBGC ( colour, " ) " );
efirc = bs->InstallMultipleProtocolInterfaces ( handle,
protocol[0], interface[0], protocol[1], interface[1],
@ -1109,7 +1109,7 @@ efi_uninstall_multiple_protocol_interfaces_wrapper ( EFI_HANDLE handle, ... ) {
void *retaddr = __builtin_return_address ( 0 );
EFI_GUID *protocol[ MAX_WRAP_MULTI + 1 ];
VOID *interface[MAX_WRAP_MULTI];
VA_LIST ap;
va_list ap;
unsigned int i;
EFI_STATUS efirc;
@ -1117,20 +1117,20 @@ efi_uninstall_multiple_protocol_interfaces_wrapper ( EFI_HANDLE handle, ... ) {
efi_handle_name ( handle ) );
memset ( protocol, 0, sizeof ( protocol ) );
memset ( interface, 0, sizeof ( interface ) );
VA_START ( ap, handle );
for ( i = 0 ; ( protocol[i] = VA_ARG ( ap, EFI_GUID * ) ) ; i++ ) {
va_start ( ap, handle );
for ( i = 0 ; ( protocol[i] = va_arg ( ap, EFI_GUID * ) ) ; i++ ) {
if ( i == MAX_WRAP_MULTI ) {
VA_END ( ap );
va_end ( ap );
efirc = EFI_OUT_OF_RESOURCES;
DBGC ( colour, "<FATAL: too many arguments> ) = %s "
"-> %p\n", efi_status ( efirc ), retaddr );
return efirc;
}
interface[i] = VA_ARG ( ap, VOID * );
interface[i] = va_arg ( ap, VOID * );
DBGC ( colour, ", %s, %p",
efi_guid_ntoa ( protocol[i] ), interface[i] );
}
VA_END ( ap );
va_end ( ap );
DBGC ( colour, " ) " );
efirc = bs->UninstallMultipleProtocolInterfaces ( handle,
protocol[0], interface[0], protocol[1], interface[1],