Add some todos

This commit is contained in:
gil 2024-05-18 09:35:00 -05:00
parent 9af10f2a8e
commit 1ff52acc42

View file

@ -1,14 +1,21 @@
unsafe extern "C" fn _enter() -> ! { use crate::abort;
unsafe extern "C" fn _enter() {
let id = riscv::register::mhartid::read(); let id = riscv::register::mhartid::read();
crate::entry::write_tp(&id); write_tp(&id);
// TODO: set up stack for all harts
// TODO: set up CSRs for all harts
if id != 0 { abort(); }
// TODO: clear BSS
// TODO: do hardware inits and wake other harts
} }
#[inline] #[inline]
unsafe fn write_tp(id: &usize) -> ! { unsafe fn write_tp(id: &usize) {
use core::arch::asm; use core::arch::asm;
asm!( asm!(
"csrw mhartid, {id}", "csrw mhartid, {id}",
id = in(reg) id, id = in(reg) id,
options(noreturn)
); );
} }