From a146d58ca0375a12f23dc5a4bd25adfa3423114f Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Fri, 8 Feb 2013 16:56:51 -0600 Subject: ramstage: prepare for relocation The current ramstage code contains uses of symbols that cause issues when the ramstage is relocatable. There are 2 scenarios resolved by this patch: 1. Absolute symbols that are actually sizes/limits. The symbols are problematic when relocating a program because there is no way to distinguish a symbol that shouldn't be relocated and one that can. The only way to handle these symbols is to write a program to post process the relocations and keep a whitelist of ones that shouldn't be relocated. I don't believe that is a route that should be taken so fix the users of these sizes/limits encoded as absolute symbols to calculate the size at runtime or dereference a variable in memory containing the size/limit. 2. Absoulte symbols that were relocated to a fixed address. These absolute symbols are generated by assembly files to be placed at a fixed location. Again, these symbols are problematic because one can't distinguish a symbol that can't be relocated. The symbols are again resolved at runtime to allow for proper relocation. For the symbols defining a size either use 2 symbols and calculate the difference or provide a variable in memory containing the size. Change-Id: I1ef2bfe6fd531308218bcaac5dcccabf8edf932c Signed-off-by: Aaron Durbin Reviewed-on: http://review.coreboot.org/2789 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones --- src/cpu/intel/haswell/mp_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/cpu/intel') diff --git a/src/cpu/intel/haswell/mp_init.c b/src/cpu/intel/haswell/mp_init.c index 3076d070ec..47683fb78c 100644 --- a/src/cpu/intel/haswell/mp_init.c +++ b/src/cpu/intel/haswell/mp_init.c @@ -66,7 +66,7 @@ struct saved_msr { extern char _binary_sipi_vector_start[]; /* These symbols are defined in c_start.S. */ extern char gdt[]; -extern char gdt_limit[]; +extern char gdt_end[]; extern char idtarg[]; /* This table keeps track of each CPU's APIC id. */ @@ -189,7 +189,7 @@ static void setup_default_sipi_vector_params(struct sipi_params *sp) int i; sp->gdt = (u32)&gdt; - sp->gdtlimit = (u32)&gdt_limit; + sp->gdtlimit = (u32)&gdt_end - (u32)&gdt - 1; sp->idt_ptr = (u32)&idtarg; sp->stack_size = CONFIG_STACK_SIZE; sp->stack_top = (u32)&_estack; -- cgit v1.2.3