mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 10:39:08 +00:00
efi_loader: allow return value in EFI_CALL
Macro EFI_CALL was introduced to call an UEFI function. Unfortunately it does not support return values. Most UEFI functions have a return value. So let's rename EFI_CALL to EFI_CALL_VOID and introduce a new EFI_CALL macro that supports return values. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
29f1a3670e
commit
ea630ce9ea
2 changed files with 17 additions and 3 deletions
|
@ -42,9 +42,22 @@ const char *__efi_nesting_dec(void);
|
|||
})
|
||||
|
||||
/*
|
||||
* Callback into UEFI world from u-boot:
|
||||
* Call non-void UEFI function from u-boot and retrieve return value:
|
||||
*/
|
||||
#define EFI_CALL(exp) do { \
|
||||
#define EFI_CALL(exp) ({ \
|
||||
debug("%sEFI: Call: %s\n", __efi_nesting_inc(), #exp); \
|
||||
assert(__efi_exit_check()); \
|
||||
typeof(exp) _r = exp; \
|
||||
assert(__efi_entry_check()); \
|
||||
debug("%sEFI: %lu returned by %s\n", __efi_nesting_dec(), \
|
||||
(unsigned long)((uintptr_t)_r & ~EFI_ERROR_MASK), #exp); \
|
||||
_r; \
|
||||
})
|
||||
|
||||
/*
|
||||
* Call void UEFI function from u-boot:
|
||||
*/
|
||||
#define EFI_CALL_VOID(exp) do { \
|
||||
debug("%sEFI: Call: %s\n", __efi_nesting_inc(), #exp); \
|
||||
assert(__efi_exit_check()); \
|
||||
exp; \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue