swissChili | 56cf817 | 2022-07-30 18:47:48 -0700 | [diff] [blame] | 1 | .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 | |||||
20 | stacks: | ||||
21 | .skip STACK_SIZE * 4 # Allocate stack space for each hart |