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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user