mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-17 08:40:52 +00:00
cleanup std interface for acram ranges
need to register memory windows to the rram object so that writes can succeed in a virtual memory environment
This commit is contained in:
parent
d10274b9ec
commit
c159ddd214
1 changed files with 13 additions and 0 deletions
|
|
@ -51,6 +51,11 @@ impl OneWayCounter {
|
||||||
ret
|
ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "std")]
|
||||||
|
pub fn register_mapping(&self, rram: &mut Reram) {
|
||||||
|
rram.add_range(ONEWAY_START - utralib::HW_RERAM_MEM, self.mapping);
|
||||||
|
}
|
||||||
|
|
||||||
pub fn get(&self, offset: usize) -> Result<u32, OneWayErr> {
|
pub fn get(&self, offset: usize) -> Result<u32, OneWayErr> {
|
||||||
#[cfg(not(feature = "std"))]
|
#[cfg(not(feature = "std"))]
|
||||||
let base = ONEWAY_START as *const u32;
|
let base = ONEWAY_START as *const u32;
|
||||||
|
|
@ -244,6 +249,14 @@ impl SlotManager {
|
||||||
Self { data_range, data_acl_range, key_range, key_acl_range, user_id }
|
Self { data_range, data_acl_range, key_range, key_acl_range, user_id }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "std")]
|
||||||
|
pub fn register_mapping(&self, rram: &mut Reram) {
|
||||||
|
rram.add_range(DATA_SLOT_START - utralib::HW_RERAM_MEM, self.data_range);
|
||||||
|
rram.add_range(ACRAM_DATASLOT_START - utralib::HW_RERAM_MEM, self.data_acl_range);
|
||||||
|
rram.add_range(KEY_SLOT_START - utralib::HW_RERAM_MEM, self.key_range);
|
||||||
|
rram.add_range(ACRAM_KEYSLOT_START - utralib::HW_RERAM_MEM, self.key_acl_range);
|
||||||
|
}
|
||||||
|
|
||||||
pub fn read(&self, slot: &SlotIndex) -> Result<&[u8], AccessError> {
|
pub fn read(&self, slot: &SlotIndex) -> Result<&[u8], AccessError> {
|
||||||
// check the ACL first
|
// check the ACL first
|
||||||
let acl = self.get_acl(slot)?;
|
let acl = self.get_acl(slot)?;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue