efi.h 1.13 KB
Newer Older
Mark Salter's avatar
Mark Salter committed
1
2
3
4
#ifndef _ASM_EFI_H
#define _ASM_EFI_H

#include <asm/io.h>
5
#include <asm/neon.h>
Mark Salter's avatar
Mark Salter committed
6
7
8
9
10
11
12
13
14

#ifdef CONFIG_EFI
extern void efi_init(void);
extern void efi_idmap_init(void);
#else
#define efi_init()
#define efi_idmap_init()
#endif

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#define efi_call_virt(f, ...)						\
({									\
	efi_##f##_t *__f = efi.systab->runtime->f;			\
	efi_status_t __s;						\
									\
	kernel_neon_begin();						\
	__s = __f(__VA_ARGS__);						\
	kernel_neon_end();						\
	__s;								\
})

#define __efi_call_virt(f, ...)						\
({									\
	efi_##f##_t *__f = efi.systab->runtime->f;			\
									\
	kernel_neon_begin();						\
	__f(__VA_ARGS__);						\
	kernel_neon_end();						\
})

35
36
37
38
39
40
41
42
43
44
45
46
/* arch specific definitions used by the stub code */

/*
 * AArch64 requires the DTB to be 8-byte aligned in the first 512MiB from
 * start of kernel and may not cross a 2MiB boundary. We set alignment to
 * 2MiB so we know it won't cross a 2MiB boundary.
 */
#define EFI_FDT_ALIGN	SZ_2M   /* used by allocate_new_fdt_and_exit_boot() */
#define MAX_FDT_OFFSET	SZ_512M

#define efi_call_early(f, ...) sys_table_arg->boottime->f(__VA_ARGS__)

47
48
#define EFI_ALLOC_ALIGN		SZ_64K

Mark Salter's avatar
Mark Salter committed
49
#endif /* _ASM_EFI_H */