Loop for non-0 hartid's
This commit is contained in:
parent
9aa8460825
commit
5df0472703
|
@ -14,6 +14,8 @@ mod uart;
|
||||||
unsafe extern "C" fn _enter() -> ! {
|
unsafe extern "C" fn _enter() -> ! {
|
||||||
use core::arch::asm;
|
use core::arch::asm;
|
||||||
asm!(
|
asm!(
|
||||||
|
"csrr t0, mhartid",
|
||||||
|
"bnez t0, 3f",
|
||||||
// before we use the `la` pseudo-instruction for the first time,
|
// before we use the `la` pseudo-instruction for the first time,
|
||||||
// we need to set `gp` (google linker relaxation)
|
// we need to set `gp` (google linker relaxation)
|
||||||
".option push", // pushes the current option stack
|
".option push", // pushes the current option stack
|
||||||
|
@ -38,6 +40,11 @@ unsafe extern "C" fn _enter() -> ! {
|
||||||
"bne t0, t1, 1b",
|
"bne t0, t1, 1b",
|
||||||
"2:",
|
"2:",
|
||||||
// BSS is clear!
|
// BSS is clear!
|
||||||
|
"j 4f",
|
||||||
|
"3:",
|
||||||
|
"wfi",
|
||||||
|
"j 3b",
|
||||||
|
"4:",
|
||||||
|
|
||||||
// "tail-call" to {start} (call without saving a return address)
|
// "tail-call" to {start} (call without saving a return address)
|
||||||
"tail {start}",
|
"tail {start}",
|
||||||
|
|
Loading…
Reference in a new issue