@@ -151,7 +151,13 @@ secondary_entry:
*/
ldr r1, =secondary_data
ldr r0, [r1]
+ mov r2, r0
+ lsr r2, #THREAD_SHIFT
+ lsl r2, #THREAD_SHIFT
+ add r3, r2, #THREAD_SIZE
+ zero_range r2, r3, r4, r5
mov sp, r0
+
bl exceptions_init
bl enable_vfp
@@ -14,10 +14,6 @@
#include <asm/thread_info.h>
#include <asm/sysreg.h>
-#ifdef CONFIG_EFI
-#include "efi/crt0-efi-aarch64.S"
-#else
-
.macro zero_range, tmp1, tmp2
9998: cmp \tmp1, \tmp2
b.eq 9997f
@@ -26,6 +22,10 @@
9997:
.endm
+#ifdef CONFIG_EFI
+#include "efi/crt0-efi-aarch64.S"
+#else
+
.section .init
/*
@@ -162,6 +162,9 @@ secondary_entry:
/* set the stack */
adrp x0, secondary_data
ldr x0, [x0, :lo12:secondary_data]
+ and x1, x0, #THREAD_MASK
+ add x2, x1, #THREAD_SIZE
+ zero_range x1, x2
mov sp, x0
/* finish init in C code */
@@ -117,7 +117,6 @@ void do_handle_exception(enum vector v, struct pt_regs *regs)
void thread_info_init(struct thread_info *ti, unsigned int flags)
{
- memset(ti, 0, sizeof(struct thread_info));
ti->cpu = mpidr_to_cpu(get_mpidr());
ti->flags = flags;
}
@@ -233,7 +233,6 @@ void install_vector_handler(enum vector v, vector_fn fn)
static void __thread_info_init(struct thread_info *ti, unsigned int flags)
{
- memset(ti, 0, sizeof(struct thread_info));
ti->cpu = mpidr_to_cpu(get_mpidr());
ti->flags = flags;
}