refactor(adapter-riscv): restructure into hw/, mmu/, trap/ modules with board constants

Add Priority::DEFAULT and TimeSlice::DEFAULT to types crate.
All QEMU virt addresses consolidated in board.rs.
Structure mirrors future adapter-arm/ layout.
This commit is contained in:
2026-10-18 02:05:57 +02:00
parent 66a730b2fe
commit d327794d33
13 changed files with 100 additions and 109 deletions

View File

@@ -3,3 +3,8 @@ use crate::macros::bounded;
bounded!(CapSlot, u8, 0, 63);
bounded!(Priority, u8, 0, 31);
bounded!(PageCount, u16, 1, 1024);
impl Priority {
pub const DEFAULT: Self = Self(16);
}

View File

@@ -25,6 +25,11 @@ pub struct TimeSlice {
}
impl TimeSlice {
pub const DEFAULT: Self = Self {
remaining: 100,
quantum: 100,
};
pub fn new(quantum: u32) -> Self {
Self {
remaining: quantum,