Signed-off-by: Dave Martin dave.martin@linaro.org --- boot.S | 15 +++++++++++++-- semi_loader.h | 6 ++++-- 2 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/boot.S b/boot.S index 128f74e..8ab68ba 100644 --- a/boot.S +++ b/boot.S @@ -96,8 +96,6 @@ start: mov r7, #0xfffffff0 smc #0 @ Set HVBAR
- enter_hyp - @ Check CPU nr again mrc p15, 0, r0, c0, c0, 5 @ MPIDR (ARMv7 only) and r0, r0, #15 @ CPU number @@ -125,6 +123,8 @@ start: ldr r1, [r0] cmp r1, #0 beq 1b + + enter_hyp mov pc, r1 @ branch to the given address #endif
@@ -170,6 +170,17 @@ __semi_call: #endif mov pc, lr
+.globl __boot_kernel +__boot_kernel: + stmfd sp!, {r0-r3} + + enter_hyp + + ldr lr, [sp], #4 + ldmfd sp!, {r0-r3} + bx lr +.type __boot_kernel, %function + @ @ Data @ diff --git a/semi_loader.h b/semi_loader.h index 6afba40..29f3d63 100644 --- a/semi_loader.h +++ b/semi_loader.h @@ -90,10 +90,12 @@ struct loader_info {
void load_kernel(struct loader_info *info);
+void __boot_kernel(unsigned entry_point, + unsigned r0, unsigned r1, unsigned r2, unsigned r3); + static void boot_kernel(struct loader_info *info, unsigned r0, unsigned r1, unsigned r2, unsigned r3) { - ((void (*)(unsigned, unsigned, unsigned, unsigned))info->kernel_entry)( - r0, r1, r2, r3); + __boot_kernel(info->kernel_entry, r0, r1, r2, r3); }
#endif /* ! SEMI_LOADER_H */