Commit 21f86625 authored by Alex Thorlton's avatar Alex Thorlton Committed by Ingo Molnar

x86/efi: Update efi_thunk() to use the the arch_efi_call_virt*() macros

Currently, the efi_thunk macro has some semi-duplicated code in it that
can be replaced with the arch_efi_call_virt_setup/teardown macros. This
commit simply replaces the duplicated code with those macros.
Suggested-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
Signed-off-by: default avatarAlex Thorlton <athorlton@sgi.com>
Signed-off-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Dimitri Sivanich <sivanich@sgi.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Roy Franz <roy.franz@linaro.org>
Cc: Russ Anderson <rja@sgi.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/1466839230-12781-7-git-send-email-matt@codeblueprint.co.uk
[ Renamed variables to the standard __ prefix. ]
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent d1be84a2
...@@ -466,22 +466,17 @@ extern efi_status_t efi64_thunk(u32, ...); ...@@ -466,22 +466,17 @@ extern efi_status_t efi64_thunk(u32, ...);
#define efi_thunk(f, ...) \ #define efi_thunk(f, ...) \
({ \ ({ \
efi_status_t __s; \ efi_status_t __s; \
unsigned long flags; \ unsigned long __flags; \
u32 func; \ u32 __func; \
\ \
efi_sync_low_kernel_mappings(); \ local_irq_save(__flags); \
local_irq_save(flags); \ arch_efi_call_virt_setup(); \
\ \
efi_scratch.prev_cr3 = read_cr3(); \ __func = runtime_service32(f); \
write_cr3((unsigned long)efi_scratch.efi_pgt); \ __s = efi64_thunk(__func, __VA_ARGS__); \
__flush_tlb_all(); \
\ \
func = runtime_service32(f); \ arch_efi_call_virt_teardown(); \
__s = efi64_thunk(func, __VA_ARGS__); \ local_irq_restore(__flags); \
\
write_cr3(efi_scratch.prev_cr3); \
__flush_tlb_all(); \
local_irq_restore(flags); \
\ \
__s; \ __s; \
}) })
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment