[PATCH 6/8] x86 boot: virtualize the efi runtime function callback addresses

From: Paul Jackson
Date: Mon Jun 16 2008 - 02:31:56 EST


From: Paul Jackson <pj@xxxxxxx>

EFI runtime service calls are provided by the EFI firmware
during boot to the kernel as physical addresses. They must
be mapped to virtual addresses when the running kernel
calls back down to these EFI service routines.

Signed-off-by: Paul Jackson <pj@xxxxxxx>

---
include/asm-x86/efi.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

--- linux.orig/include/asm-x86/efi.h 2008-06-10 21:31:24.000000000 -0700
+++ linux/include/asm-x86/efi.h 2008-06-13 03:48:21.086399220 -0700
@@ -68,22 +68,22 @@ extern u64 efi_call6(void *fp, u64 arg1,
(u64)(a4), (u64)(a5), (u64)(a6))

#define efi_call_virt0(f) \
- efi_call0((void *)(efi.systab->runtime->f))
+ efi_call0((void *)__va(efi.systab->runtime->f))
#define efi_call_virt1(f, a1) \
- efi_call1((void *)(efi.systab->runtime->f), (u64)(a1))
+ efi_call1((void *)__va(efi.systab->runtime->f), (u64)(a1))
#define efi_call_virt2(f, a1, a2) \
- efi_call2((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2))
+ efi_call2((void *)__va(efi.systab->runtime->f), (u64)(a1), (u64)(a2))
#define efi_call_virt3(f, a1, a2, a3) \
- efi_call3((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \
+ efi_call3((void *)__va(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \
(u64)(a3))
#define efi_call_virt4(f, a1, a2, a3, a4) \
- efi_call4((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \
+ efi_call4((void *)__va(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \
(u64)(a3), (u64)(a4))
#define efi_call_virt5(f, a1, a2, a3, a4, a5) \
- efi_call5((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \
+ efi_call5((void *)__va(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \
(u64)(a3), (u64)(a4), (u64)(a5))
#define efi_call_virt6(f, a1, a2, a3, a4, a5, a6) \
- efi_call6((void *)(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \
+ efi_call6((void *)__va(efi.systab->runtime->f), (u64)(a1), (u64)(a2), \
(u64)(a3), (u64)(a4), (u64)(a5), (u64)(a6))

extern void *efi_ioremap(unsigned long addr, unsigned long size);

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@xxxxxxx> 1.650.933.1373
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/