blob: a34fd3b12e2b963bbbfec66c253a15dd0859df13 [file] [log] [blame]
Mark Salterf84d0272014-04-15 21:59:30 -04001#ifndef _ASM_EFI_H
2#define _ASM_EFI_H
3
4#include <asm/io.h>
Ard Biesheuvele15dd492014-07-04 19:41:53 +02005#include <asm/neon.h>
Mark Salterf84d0272014-04-15 21:59:30 -04006
7#ifdef CONFIG_EFI
8extern void efi_init(void);
9extern void efi_idmap_init(void);
10#else
11#define efi_init()
12#define efi_idmap_init()
13#endif
14
Ard Biesheuvele15dd492014-07-04 19:41:53 +020015#define efi_call_virt(f, ...) \
16({ \
17 efi_##f##_t *__f = efi.systab->runtime->f; \
18 efi_status_t __s; \
19 \
20 kernel_neon_begin(); \
21 __s = __f(__VA_ARGS__); \
22 kernel_neon_end(); \
23 __s; \
24})
25
26#define __efi_call_virt(f, ...) \
27({ \
28 efi_##f##_t *__f = efi.systab->runtime->f; \
29 \
30 kernel_neon_begin(); \
31 __f(__VA_ARGS__); \
32 kernel_neon_end(); \
33})
34
Ard Biesheuvela13b0072014-07-02 14:54:41 +020035/* arch specific definitions used by the stub code */
36
37/*
38 * AArch64 requires the DTB to be 8-byte aligned in the first 512MiB from
39 * start of kernel and may not cross a 2MiB boundary. We set alignment to
40 * 2MiB so we know it won't cross a 2MiB boundary.
41 */
42#define EFI_FDT_ALIGN SZ_2M /* used by allocate_new_fdt_and_exit_boot() */
43#define MAX_FDT_OFFSET SZ_512M
44
45#define efi_call_early(f, ...) sys_table_arg->boottime->f(__VA_ARGS__)
46
Mark Salterf84d0272014-04-15 21:59:30 -040047#endif /* _ASM_EFI_H */