Aaron Durbin (adurbin@google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5086
-gerrit
commit bbdf01de632e76ef437fbc1dcd53c1048af95007 Author: Aaron Durbin adurbin@chromium.org Date: Thu Jan 30 15:48:29 2014 -0600
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 adurbin@chromium.org --- src/arch/x86/include/arch/stages.h | 8 ++++++++ src/arch/x86/lib/cbfs_and_run.c | 5 +---- src/vendorcode/google/chromeos/vboot_loader.c | 7 ++----- 3 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/arch/x86/include/arch/stages.h b/src/arch/x86/include/arch/stages.h index 8cbf5da..91d0db6 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 diff --git a/src/arch/x86/lib/cbfs_and_run.c b/src/arch/x86/lib/cbfs_and_run.c index 6379842..3d56e19 100644 --- a/src/arch/x86/lib/cbfs_and_run.c +++ b/src/arch/x86/lib/cbfs_and_run.c @@ -34,10 +34,7 @@ static void cbfs_and_run_core(const char *filename)
timestamp_add_now(TS_END_COPYRAM); print_debug("Jumping to image.\n"); - __asm__ volatile ( - "jmp *%%edi\n" - :: "D"(dst) - ); + stage_exit(dst); }
void asmlinkage copy_and_run(void) diff --git a/src/vendorcode/google/chromeos/vboot_loader.c b/src/vendorcode/google/chromeos/vboot_loader.c index badff27..cc7c25d 100644 --- a/src/vendorcode/google/chromeos/vboot_loader.c +++ b/src/vendorcode/google/chromeos/vboot_loader.c @@ -17,6 +17,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+#include <arch/stages.h> #include <stdint.h> #include <stddef.h> #include <cbfs.h> @@ -180,11 +181,7 @@ static void vboot_load_ramstage(struct vboot_handoff *vboot_handoff,
timestamp_add_now(TS_END_COPYRAM);
- __asm__ volatile ( - "movl $0, %%ebp\n" - "jmp *%%edi\n" - :: "D"(rmod_load.entry) - ); + stage_exit(rmod_load.entry); }
void vboot_verify_firmware(struct romstage_handoff *handoff)