make scheduler quantum a visible parameter, and adjust to 10ms down from 20ms

This commit is contained in:
bunnie 2022-05-12 17:49:03 +08:00
parent caf91e18ca
commit 0aa2f21f0b
2 changed files with 4 additions and 1 deletions

View file

@ -39,7 +39,7 @@ mod implementation {
use num_traits::ToPrimitive;
const SYSTEM_CLOCK_FREQUENCY: u32 = 12_000_000; // timer0 is now in the always-on domain
const SYSTEM_TICK_INTERVAL_MS: u32 = 20;
const SYSTEM_TICK_INTERVAL_MS: u32 = xous::BASE_QUANTA_MS;
fn timer_tick(_irq_no: usize, arg: *mut usize) {
let mut timer = CSR::new(arg as *mut u32);

View file

@ -40,6 +40,9 @@ pub const EC_REGION_LEN: u32 = 0x0008_0000;
pub const PDDB_LOC: u32 = 0x01D8_0000; // PDDB start
pub const PDDB_LEN: u32 = EC_REGION_LOC - PDDB_LOC; // must be 64k-aligned (bulk erase block size) for proper function.
// quantum alloted to each process before a context switch is forced
pub const BASE_QUANTA_MS: u32 = 10;
#[cfg(not(any(target_os = "none", target_os = "xous")))]
use core::sync::atomic::AtomicU64;