diff options
author | Michael Brown <mcb30@ipxe.org> | 2024-09-15 02:01:46 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2024-09-15 10:01:35 +0100 |
commit | 670810bed841678e6303719bb123edad9857f320 (patch) | |
tree | 7b533d9c8cf40517adf9c332d3112018c0e9768e | |
parent | 1d43e535fb86537cb87f30c7fa45b175534489d6 (diff) | |
download | ipxe-670810bed841678e6303719bb123edad9857f320.tar.gz |
[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>
-rw-r--r-- | src/interface/efi/efi_wrap.c | 24 |
1 files changed, 12 insertions, 12 deletions
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, "<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], |