+ assert(__efi_entry_check()); \
+ debug("%sEFI: Entry %s(" format ")\n", __efi_nesting_inc(), \
+ __func__, ##__VA_ARGS__); \
+ } while(0)
+
+/*
+ * Exit the u-boot world back to UEFI:
+ */
+#define EFI_EXIT(ret) ({ \
+ typeof(ret) _r = ret; \
+ debug("%sEFI: Exit: %s: %u\n", __efi_nesting_dec(), \
+ __func__, (u32)((uintptr_t) _r & ~EFI_ERROR_MASK)); \
+ assert(__efi_exit_check()); \
+ _r; \
+ })
+
+/*
+ * Call non-void UEFI function from u-boot and retrieve return value:
+ */
+#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; \
+ assert(__efi_entry_check()); \
+ debug("%sEFI: Return From: %s\n", __efi_nesting_dec(), #exp); \