Index: sys/arch/aarch64/aarch64/locore.S =================================================================== RCS file: /cvsroot/src/sys/arch/aarch64/aarch64/locore.S,v retrieving revision 1.42 diff -u -p -w -b -r1.42 locore.S --- sys/arch/aarch64/aarch64/locore.S 19 Oct 2019 18:04:26 -0000 1.42 +++ sys/arch/aarch64/aarch64/locore.S 20 Oct 2019 12:01:40 -0000 @@ -378,10 +376,10 @@ ENTRY_NP(cpu_mpstart) /* set stack pointer for boot */ mov x1, #BOOT_AP_STACKSIZE - mul x1, x1, x27 + sub x2, x27, #1 + mul x1, x1, x2 ADDR x0, bootstk_cpus - sub sp, x0, x1 /* sp = bootstk_cpus-(BOOT_AP_STACKSIZE*cpuindex) */ - + sub sp, x0, x1 /* sp = bootstk_cpus - (BOOT_AP_STACKSIZE * (cpuindex - 1)) */ bl 1f 1: CPU_DPRINTREG("PC = ", lr) @@ -450,6 +447,8 @@ mp_vstart: * atomic_or_uint(&aarch64_cpu_mbox[cpuindex], 1) * to tell my activity to primary processor. */ + ADDR x0, _C_LABEL(aarch64_cpu_mbox) + add x28, x0, x27, lsl #2 /* x28 = &aarch64_cpu_mbox[cpuindex] */ mov x0, x28 mov x1, #1 bl _C_LABEL(atomic_or_uint) /* hatched! */ @@ -459,8 +458,8 @@ mp_vstart: /* wait for the mailbox start bit to become true */ 1: dmb sy - ldr x20, [x28] - tst x20, #2 + ldr w20, [x28] + tst w20, #2 bne 9f wfe b 1b