temp stage

This commit is contained in:
Yu Chen 2023-01-02 20:06:03 +08:00
parent 58bf26222f
commit 2e57ec432a
5 changed files with 190 additions and 40 deletions

View file

@ -56,10 +56,11 @@ pub fn irq_handler() {
// core local interrupter (CLINT), which contains the timer
pub const CLINT: usize = 0x2000000;
pub const fn clint_mtimecmp(hartid: usize) -> usize {
CLINT + 0x4000 + 8 * hartid
}
// pub const fn clint_mtimecmp(hartid: usize) -> usize {
// CLINT + 0x4000 + 8 * hartid
// }
pub const CLINT_MTIME: usize = CLINT + 0xBFF8; // Cycles since boot.
pub const CLINT_MTIMECMP: usize = CLINT + 0x4000;
#[naked]
#[repr(align(16))] // if miss this alignment, a load access fault will occur.