[add] laos using xv6-riscv thought
This commit is contained in:
20
laos/src/kernel/entry.S
Normal file
20
laos/src/kernel/entry.S
Normal file
@@ -0,0 +1,20 @@
|
||||
#include "asm.h"
|
||||
|
||||
.section .entry
|
||||
.global _entry
|
||||
_entry:
|
||||
# set up a stack for C.
|
||||
# stack0 is declared in start.c,
|
||||
# with a 4096-byte stack per CPU.
|
||||
# sp = stack0 + (hartid * 4096)
|
||||
la.global $sp, stack0
|
||||
lu12i.w $a0, (1024*4 >> 12) & 0xfffff
|
||||
addi.w $a0, $a0, 1024*4 & 0xfff
|
||||
csrrd $a1, CPUID
|
||||
addi.w $a1, $a1, 1
|
||||
mul.w $a0, $a0, $a1
|
||||
add.w $sp, $sp, $a0
|
||||
# jump to start() in start.c
|
||||
bl start
|
||||
spin:
|
||||
b spin
|
||||
Reference in New Issue
Block a user