From b3847e64242228166976f425cd42331db7857551 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Fri, 20 Mar 2015 15:55:08 -0500 Subject: program loading: add prog_run() function The prog_run() function abstracts away what is required for running a given program. Within it, there are 2 calls: 1. platform_prog_run() and 2. arch_prog_run(). The platform_prog_run() allows for a chipset to intercept a program that will be run. This allows for CPU switching as currently needed in t124 and t132. Change-Id: I22a5dd5bfb1018e7e46475e47ac993a0941e2a8c Signed-off-by: Aaron Durbin Reviewed-on: http://review.coreboot.org/8846 Tested-by: build bot (Jenkins) Tested-by: Raptor Engineering Automated Test Stand Reviewed-by: Marc Jones --- src/arch/x86/boot/Makefile.inc | 1 + src/arch/x86/boot/boot.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/arch/x86') diff --git a/src/arch/x86/boot/Makefile.inc b/src/arch/x86/boot/Makefile.inc index 9f06b4f4eb..7810ba8368 100644 --- a/src/arch/x86/boot/Makefile.inc +++ b/src/arch/x86/boot/Makefile.inc @@ -2,6 +2,7 @@ ifeq ($(CONFIG_ARCH_ROMSTAGE_X86_32),y) romstage-y += cbmem.c +romstage-y += boot.c endif # CONFIG_ARCH_ROMSTAGE_X86_32 diff --git a/src/arch/x86/boot/boot.c b/src/arch/x86/boot/boot.c index 1fb36e2827..d5365842d2 100644 --- a/src/arch/x86/boot/boot.c +++ b/src/arch/x86/boot/boot.c @@ -123,7 +123,7 @@ static void jmp_payload(void *entry, unsigned long buffer, unsigned long size) ); } -void arch_payload_run(const struct payload *payload) +void arch_payload_run(struct payload *payload) { if (IS_ENABLED(CONFIG_RELOCATABLE_RAMSTAGE)) jmp_payload_no_bounce_buffer(prog_entry(&payload->prog)); @@ -132,3 +132,11 @@ void arch_payload_run(const struct payload *payload) (uintptr_t)payload->bounce.data, payload->bounce.size); } + +void arch_prog_run(struct prog *prog) +{ + __asm__ volatile ( + "jmp *%%edi\n" + :: "D"(prog_entry(prog)) + ); +} -- cgit v1.2.3