mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +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
|
||||
}
|
||||
|
||||
#[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> {
|
||||
#[cfg(not(feature = "std"))]
|
||||
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 }
|
||||
}
|
||||
|
||||
#[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> {
|
||||
// check the ACL first
|
||||
let acl = self.get_acl(slot)?;
|
||||
|
|
|
|||
Loading…
Reference in a new issue