efi.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef _ASM_EFI_H
  2. #define _ASM_EFI_H
  3. #include <asm/io.h>
  4. #include <asm/neon.h>
  5. #ifdef CONFIG_EFI
  6. extern void efi_init(void);
  7. extern void efi_idmap_init(void);
  8. #else
  9. #define efi_init()
  10. #define efi_idmap_init()
  11. #endif
  12. #define efi_call_virt(f, ...) \
  13. ({ \
  14. efi_##f##_t *__f = efi.systab->runtime->f; \
  15. efi_status_t __s; \
  16. \
  17. kernel_neon_begin(); \
  18. __s = __f(__VA_ARGS__); \
  19. kernel_neon_end(); \
  20. __s; \
  21. })
  22. #define __efi_call_virt(f, ...) \
  23. ({ \
  24. efi_##f##_t *__f = efi.systab->runtime->f; \
  25. \
  26. kernel_neon_begin(); \
  27. __f(__VA_ARGS__); \
  28. kernel_neon_end(); \
  29. })
  30. /* arch specific definitions used by the stub code */
  31. /*
  32. * AArch64 requires the DTB to be 8-byte aligned in the first 512MiB from
  33. * start of kernel and may not cross a 2MiB boundary. We set alignment to
  34. * 2MiB so we know it won't cross a 2MiB boundary.
  35. */
  36. #define EFI_FDT_ALIGN SZ_2M /* used by allocate_new_fdt_and_exit_boot() */
  37. #define MAX_FDT_OFFSET SZ_512M
  38. #define efi_call_early(f, ...) sys_table_arg->boottime->f(__VA_ARGS__)
  39. #endif /* _ASM_EFI_H */