diff options
author | Julien Grall <julien.grall@linaro.org> | 2013-09-26 12:09:35 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2013-09-26 15:41:50 +0100 |
commit | f70263755ae0741d351caac0517b1ffaca646182 (patch) | |
tree | fa6482392ba827f4e5c7224b96b3a5748dcba27f | |
parent | ec206e8ee4833c87746b0ef1e2e7ceeddc53e5f7 (diff) | |
download | xen-f70263755ae0741d351caac0517b1ffaca646182.tar.gz xen-f70263755ae0741d351caac0517b1ffaca646182.tar.bz2 xen-f70263755ae0741d351caac0517b1ffaca646182.zip |
xen/arm: Introduce init_info structure
This structure will gather all information to boot a secondary cpus.
For now it just contains the initial stack.
Signed-off-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
-rw-r--r-- | xen/arch/arm/arm32/asm-offsets.c | 4 | ||||
-rw-r--r-- | xen/arch/arm/arm32/head.S | 3 | ||||
-rw-r--r-- | xen/arch/arm/arm64/asm-offsets.c | 3 | ||||
-rw-r--r-- | xen/arch/arm/arm64/head.S | 3 | ||||
-rw-r--r-- | xen/arch/arm/smpboot.c | 9 | ||||
-rw-r--r-- | xen/include/asm-arm/init.h | 6 |
6 files changed, 23 insertions, 5 deletions
diff --git a/xen/arch/arm/arm32/asm-offsets.c b/xen/arch/arm/arm32/asm-offsets.c index 263fff3c57..ac628c00eb 100644 --- a/xen/arch/arm/arm32/asm-offsets.c +++ b/xen/arch/arm/arm32/asm-offsets.c @@ -69,6 +69,10 @@ void __dummy__(void) OFFSET(PROCINFO_cpu_val, struct proc_info_list, cpu_val); OFFSET(PROCINFO_cpu_mask, struct proc_info_list, cpu_mask); OFFSET(PROCINFO_cpu_init, struct proc_info_list, cpu_init); + + BLANK(); + OFFSET(INITINFO_stack, struct init_info, stack); + } /* diff --git a/xen/arch/arm/arm32/head.S b/xen/arch/arm/arm32/head.S index 79e95b673c..fce18a2d98 100644 --- a/xen/arch/arm/arm32/head.S +++ b/xen/arch/arm/arm32/head.S @@ -366,7 +366,8 @@ paging: bne 1b launch: - ldr r0, =init_stack /* Find the boot-time stack */ + ldr r0, =init_data + add r0, #INITINFO_stack /* Find the boot-time stack */ ldr sp, [r0] add sp, #STACK_SIZE /* (which grows down from the top). */ sub sp, #CPUINFO_sizeof /* Make room for CPU save record */ diff --git a/xen/arch/arm/arm64/asm-offsets.c b/xen/arch/arm/arm64/asm-offsets.c index 2a225b6653..d7572fa650 100644 --- a/xen/arch/arm/arm64/asm-offsets.c +++ b/xen/arch/arm/arm64/asm-offsets.c @@ -46,6 +46,9 @@ void __dummy__(void) DEFINE(CPUINFO_sizeof, sizeof(struct cpu_info)); OFFSET(VCPU_arch_saved_context, struct vcpu, arch.saved_context); + + BLANK(); + OFFSET(INITINFO_stack, struct init_info, stack); } /* diff --git a/xen/arch/arm/arm64/head.S b/xen/arch/arm/arm64/head.S index 21b7e4d741..e0831b6fd7 100644 --- a/xen/arch/arm/arm64/head.S +++ b/xen/arch/arm/arm64/head.S @@ -313,7 +313,8 @@ paging: b.ne 1b launch: - ldr x0, =init_stack /* Find the boot-time stack */ + ldr x0, =init_data + add x0, x0, #INITINFO_stack /* Find the boot-time stack */ ldr x0, [x0] add x0, x0, #STACK_SIZE /* (which grows down from the top). */ sub x0, x0, #CPUINFO_sizeof /* Make room for CPU save record */ diff --git a/xen/arch/arm/smpboot.c b/xen/arch/arm/smpboot.c index b6aea63e18..945f4739a9 100644 --- a/xen/arch/arm/smpboot.c +++ b/xen/arch/arm/smpboot.c @@ -46,8 +46,11 @@ nodemask_t __read_mostly node_online_map = { { [0] = 1UL } }; static unsigned char __initdata cpu0_boot_stack[STACK_SIZE] __attribute__((__aligned__(STACK_SIZE))); -/* Pointer to the stack, used by head.S when entering C */ -unsigned char *init_stack = cpu0_boot_stack; +/* Initial boot cpu data */ +struct init_info __initdata init_data = +{ + .stack = cpu0_boot_stack, +}; /* Shared state for coordinating CPU bringup */ unsigned long smp_up_cpu = 0; @@ -224,7 +227,7 @@ int __cpu_up(unsigned int cpu) return rc; /* Tell the remote CPU which stack to boot on. */ - init_stack = idle_vcpu[cpu]->arch.stack; + init_data.stack = idle_vcpu[cpu]->arch.stack; /* Unblock the CPU. It should be waiting in the loop in head.S * for an event to arrive when smp_up_cpu matches its cpuid. */ diff --git a/xen/include/asm-arm/init.h b/xen/include/asm-arm/init.h index 237ec25e4e..7a07136eb4 100644 --- a/xen/include/asm-arm/init.h +++ b/xen/include/asm-arm/init.h @@ -1,6 +1,12 @@ #ifndef _XEN_ASM_INIT_H #define _XEN_ASM_INIT_H +struct init_info +{ + /* Pointer to the stack, used by head.S when entering in C */ + unsigned char *stack; +}; + #endif /* _XEN_ASM_INIT_H */ /* * Local variables: |