mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-22 09:23:16 +00:00
format services/cram-console
This commit is contained in:
parent
05dd566976
commit
774c897a96
1 changed files with 29 additions and 26 deletions
|
|
@ -29,23 +29,26 @@ fn main() {
|
|||
let mut coreuser = CSR::new(coreuser_csr.as_mut_ptr() as *mut u32);
|
||||
// first, clear the ASID table to 0
|
||||
for asid in 0..512 {
|
||||
coreuser.wo(utra::coreuser::SET_ASID,
|
||||
coreuser.wo(
|
||||
utra::coreuser::SET_ASID,
|
||||
coreuser.ms(utra::coreuser::SET_ASID_ASID, asid)
|
||||
| coreuser.ms(utra::coreuser::SET_ASID_TRUSTED, 0)
|
||||
| coreuser.ms(utra::coreuser::SET_ASID_TRUSTED, 0),
|
||||
);
|
||||
}
|
||||
// set my PID to trusted
|
||||
coreuser.wo(utra::coreuser::SET_ASID,
|
||||
coreuser.wo(
|
||||
utra::coreuser::SET_ASID,
|
||||
coreuser.ms(utra::coreuser::SET_ASID_ASID, xous::process::id() as u32)
|
||||
| coreuser.ms(utra::coreuser::SET_ASID_TRUSTED, 1)
|
||||
| coreuser.ms(utra::coreuser::SET_ASID_TRUSTED, 1),
|
||||
);
|
||||
// set the required `mpp` state to user code (mpp == 0)
|
||||
coreuser.wfo(utra::coreuser::SET_PRIVILEGE_MPP, 0);
|
||||
// turn on the coreuser computation
|
||||
coreuser.wo(utra::coreuser::CONTROL,
|
||||
coreuser.wo(
|
||||
utra::coreuser::CONTROL,
|
||||
coreuser.ms(utra::coreuser::CONTROL_ASID, 1)
|
||||
| coreuser.ms(utra::coreuser::CONTROL_ENABLE, 1)
|
||||
| coreuser.ms(utra::coreuser::CONTROL_PRIVILEGE, 1)
|
||||
| coreuser.ms(utra::coreuser::CONTROL_PRIVILEGE, 1),
|
||||
);
|
||||
// turn off coreuser control updates
|
||||
coreuser.wo(utra::coreuser::PROTECT, 1);
|
||||
|
|
|
|||
Loading…
Reference in a new issue