diff options
author | Rob Clark <robdclark@gmail.com> | 2017-07-27 08:04:17 -0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2017-07-28 09:15:45 +0200 |
commit | a095aadffa96f3814d5605792674a6d64951db51 (patch) | |
tree | 451ddae5da88f5ab5468442390254fb1ae310cb1 /include/efi_loader.h | |
parent | 3f1aa97577b75ee2f4f13d2b9fbaf68ce89f42be (diff) |
efi_loader: Add an EFI_CALL() macro
Rather than open-coding EFI_EXIT() + callback + EFI_ENTRY(), introduce
an EFI_CALL() macro. This makes callbacks into UEFI world (of which
there will be more in the future) more concise and easier to locate in
the code.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'include/efi_loader.h')
-rw-r--r-- | include/efi_loader.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/efi_loader.h b/include/efi_loader.h index 9700a88d69..eb16c14b69 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -15,17 +15,34 @@ #include <linux/list.h> +/* + * Enter the u-boot world from UEFI: + */ #define EFI_ENTRY(format, ...) do { \ efi_restore_gd(); \ debug("EFI: Entry %s(" format ")\n", __func__, ##__VA_ARGS__); \ } while(0) +/* + * Exit the u-boot world back to UEFI: + */ #define EFI_EXIT(ret) ({ \ efi_status_t _r = ret; \ debug("EFI: Exit: %s: %u\n", __func__, (u32)(_r & ~EFI_ERROR_MASK)); \ efi_exit_func(_r); \ }) +/* + * Callback into UEFI world from u-boot: + */ +#define EFI_CALL(exp) do { \ + debug("EFI: Call: %s\n", #exp); \ + efi_exit_func(EFI_SUCCESS); \ + exp; \ + efi_restore_gd(); \ + debug("EFI: Return From: %s\n", #exp); \ + } while(0) + extern struct efi_runtime_services efi_runtime_services; extern struct efi_system_table systab; |