blob: 6578eba07ebbe235fa0c93039b0135f80ff411e1 [file] [log] [blame]
swissChili56cf8172022-07-30 18:47:48 -07001 .equ STACK_SIZE, 8192
2
3 .global _start
4
5_start:
6 csrr t0, mhartid
7 slli t0, t0, 10 # mhartid << 10
8 la sp, stacks + STACK_SIZE # set up space for hart stacks
9 add sp, sp, t0 # sp += (mhartid << 10)
10
11 ## For now, only run on hart 0
12 csrr a0, mhartid # pass hart id to kmain
13 bnez a0, .end
14 j kmain
15
16.end:
17 wfi
18 j .end
19
20stacks:
21 .skip STACK_SIZE * 4 # Allocate stack space for each hart