From 670810bed841678e6303719bb123edad9857f320 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sun, 15 Sep 2024 02:01:46 +0100 Subject: [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 --- src/interface/efi/efi_wrap.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/interface/efi') diff --git a/src/interface/efi/efi_wrap.c b/src/interface/efi/efi_wrap.c index 5d5d2caee..c2fab6647 100644 --- a/src/interface/efi/efi_wrap.c +++ b/src/interface/efi/efi_wrap.c @@ -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, " ) = %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, " ) = %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], -- cgit