Fix secondary stacks calculation on ARM64

Secondary stack calculation is modified to provide
stack_top = secondary_stacks + (cpu_id) * PAGE_SIZE * KSTACK_PAGES
because on ARM64 the stack grows to lower memory addresses.

Obtained from: Semihalf
Sponsored by:  The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3107
This commit is contained in:
Zbigniew Bodek 2015-07-17 14:08:08 +00:00
parent d5dfc8ad00
commit ab89029bd0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=285654

View File

@ -179,8 +179,7 @@ ENTRY(mpentry)
mp_virtdone:
ldr x4, =secondary_stacks
mov x5, #(PAGE_SIZE * KSTACK_PAGES)
sub x1, x0, #1
mul x5, x1, x5
mul x5, x0, x5
add sp, x4, x5
b init_secondary