diff options
author | Huang, Ying <ying.huang@intel.com> | 2008-01-30 07:31:19 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:31:19 -0500 |
commit | 5b83683f32b113d07edfb67a33ce389fc624423d (patch) | |
tree | 03efde0750c9d7e477ab695aeee26173ffcc4abf /include/asm-x86/efi.h | |
parent | 8c8b8859b64baf6d7c33900e8720c7bafe775b2c (diff) |
x86: EFI runtime service support
This patch adds basic runtime services support for EFI x86_64 system. The
main file of the patch is the addition of efi_64.c for x86_64. This file is
modeled after the EFI IA32 avatar. EFI runtime services initialization are
implemented in efi_64.c. Some x86_64 specifics are worth noting here. On
x86_64, parameters passed to EFI firmware services need to follow the EFI
calling convention. For this purpose, a set of functions named efi_call<x>
(<x> is the number of parameters) are implemented. EFI function calls are
wrapped before calling the firmware service. The duplicated code between
efi_32.c and efi_64.c is placed in efi.c to remove them from efi_32.c.
Signed-off-by: Chandramouli Narayanan <mouli@linux.intel.com>
Signed-off-by: Huang Ying <ying.huang@intel.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/efi.h')
-rw-r--r-- | include/asm-x86/efi.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/include/asm-x86/efi.h b/include/asm-x86/efi.h new file mode 100644 index 000000000000..1459d3d58653 --- /dev/null +++ b/include/asm-x86/efi.h | |||
@@ -0,0 +1,70 @@ | |||
1 | #ifndef _ASM_X86_EFI_H | ||
2 | #define _ASM_X86_EFI_H | ||
3 | |||
4 | #ifdef CONFIG_X86_32 | ||
5 | #else /* !CONFIG_X86_32 */ | ||
6 | |||
7 | #define MAX_EFI_IO_PAGES 100 | ||
8 | |||
9 | extern u64 efi_call0(void *fp); | ||
10 | extern u64 efi_call1(void *fp, u64 arg1); | ||
11 | extern u64 efi_call2(void *fp, u64 arg1, u64 arg2); | ||
12 | extern u64 efi_call3(void *fp, u64 arg1, u64 arg2, u64 arg3); | ||
13 | extern u64 efi_call4(void *fp, u64 arg1, u64 arg2, u64 arg3, u64 arg4); | ||
14 | extern u64 efi_call5(void *fp, u64 arg1, u64 arg2, u64 arg3, | ||
15 | u64 arg4, u64 arg5); | ||
16 | extern u64 efi_call6(void *fp, u64 arg1, u64 arg2, u64 arg3, | ||
17 | u64 arg4, u64 arg5, u64 arg6); | ||
18 | |||
19 | #define efi_call_phys0(f) \ | ||
20 | efi_call0((void *)(f)) | ||
21 | #define efi_call_phys1(f, a1) \ | ||
22 | efi_call1((void *)(f), (u64)(a1)) | ||
23 | #define efi_call_phys2(f, a1, a2) \ | ||
24 | efi_call2((void *)(f), (u64)(a1), (u64)(a2)) | ||
25 | #define efi_call_phys3(f, a1, a2, a3) \ | ||
26 | efi_call3((void *)(f), (u64)(a1), (u64)(a2), (u64)(a3)) | ||
27 | #define efi_call_phys4(f, a1, a2, a3, a4) \ | ||
28 | efi_call4((void *)(f), (u64)(a1), (u64)(a2), (u64)(a3), \ | ||
29 | (u64)(a4)) | ||
30 | #define efi_call_phys5(f, a1, a2, a3, a4, a5) \ | ||
31 | efi_call5((void *)(f), (u64)(a1), (u64)(a2), (u64)(a3), \ | ||
32 | (u64)(a4), (u64)(a5)) | ||
33 | #define efi_call_phys6(f, a1, a2, a3, a4, a5, a6) \ | ||
34 | efi_call6((void *)(f), (u64)(a1), (u64)(a2), (u64)(a3), \ | ||
35 | (u64)(a4), (u64)(a5), (u64)(a6)) | ||
36 | |||
37 | #define efi_call_virt0(f) \ | ||
38 | efi_call0((void *)(efi.systab->runtime->f)) | ||
39 | #define efi_call_virt1(f, a1) \ | ||
40 | efi_call1((void *)(efi.systab->runtime->f), (u64)(a1)) | ||
41 | #define efi_call_virt2(f, a1, a2) \ | ||
42 | efi_call2((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2)) | ||
43 | #define efi_call_virt3(f, a1, a2, a3) \ | ||
44 | efi_call3((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \ | ||
45 | (u64)(a3)) | ||
46 | #define efi_call_virt4(f, a1, a2, a3, a4) \ | ||
47 | efi_call4((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \ | ||
48 | (u64)(a3), (u64)(a4)) | ||
49 | #define efi_call_virt5(f, a1, a2, a3, a4, a5) \ | ||
50 | efi_call5((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \ | ||
51 | (u64)(a3), (u64)(a4), (u64)(a5)) | ||
52 | #define efi_call_virt6(f, a1, a2, a3, a4, a5, a6) \ | ||
53 | efi_call6((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \ | ||
54 | (u64)(a3), (u64)(a4), (u64)(a5), (u64)(a6)) | ||
55 | |||
56 | #define efi_early_ioremap(addr, size) early_ioremap(addr, size) | ||
57 | #define efi_early_iounmap(vaddr, size) early_iounmap(vaddr, size) | ||
58 | |||
59 | extern void *efi_ioremap(unsigned long offset, unsigned long size); | ||
60 | |||
61 | extern int efi_time; | ||
62 | |||
63 | #endif /* CONFIG_X86_32 */ | ||
64 | |||
65 | extern void efi_reserve_bootmem(void); | ||
66 | extern void efi_call_phys_prelog(void); | ||
67 | extern void efi_call_phys_epilog(void); | ||
68 | extern void runtime_code_page_mkexec(void); | ||
69 | |||
70 | #endif | ||