mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
map out PID 0's access in going to secure mode
This commit is contained in:
parent
0d369f8a9f
commit
d44f489a83
1 changed files with 4 additions and 0 deletions
|
|
@ -151,6 +151,10 @@ impl Coreuser {
|
||||||
|
|
||||||
/// Sets a "one way door" that disallows any further updating to these fields.
|
/// Sets a "one way door" that disallows any further updating to these fields.
|
||||||
pub fn protect(&mut self) {
|
pub fn protect(&mut self) {
|
||||||
|
// map default ASID into the least trusted user (away from boot0)
|
||||||
|
self.csr.rmwf(utra::coreuser::MAP_HI_LUT7, 0);
|
||||||
|
self.csr.rmwf(utra::coreuser::USERVALUE_USER7, LEAST_TRUSTED_USER.as_dense());
|
||||||
|
|
||||||
// invert sense for Xous mode - User process 3 is trusted, the kernel is not!
|
// invert sense for Xous mode - User process 3 is trusted, the kernel is not!
|
||||||
self.csr.rmwf(utra::coreuser::CONTROL_INVERT_PRIV, 1);
|
self.csr.rmwf(utra::coreuser::CONTROL_INVERT_PRIV, 1);
|
||||||
self.csr.wo(utra::coreuser::PROTECT, 1);
|
self.csr.wo(utra::coreuser::PROTECT, 1);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue