From e9aaa71fb1e05c4432d768d87071ef842c536cb4 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Thu, 30 Jan 2014 15:48:29 -0600 Subject: x86: provide stage_exit() like arm The arm architectures have a stage_exit() function which takes a void * pointer as an entry point. Provide the same API for x86. This can make the booting paths less architecture-specific. Change-Id: I4ecfbf32f38f2e3817381b63e1f97e92654c5f97 Signed-off-by: Aaron Durbin Reviewed-on: http://review.coreboot.org/5086 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/arch/x86/include/arch/stages.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/arch/x86/include') diff --git a/src/arch/x86/include/arch/stages.h b/src/arch/x86/include/arch/stages.h index 8cbf5da34a..91d0db6957 100644 --- a/src/arch/x86/include/arch/stages.h +++ b/src/arch/x86/include/arch/stages.h @@ -24,4 +24,12 @@ void asmlinkage copy_and_run(void); void jmp_to_elf_entry(void *entry, unsigned long buffer, unsigned long size); + +static inline void stage_exit(void *entry) +{ + __asm__ volatile ( + "jmp *%%edi\n" + :: "D"(entry) + ); +} #endif -- cgit v1.2.3