mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-21 09:14:34 +00:00
note timeouts on read in the HAL driver
This commit is contained in:
parent
818372a604
commit
1faaf2c092
1 changed files with 20 additions and 3 deletions
|
|
@ -110,12 +110,29 @@ impl SwapHal {
|
||||||
nonce[9..12].copy_from_slice(&(vpage_masked as u32).to_be_bytes()[..3]);
|
nonce[9..12].copy_from_slice(&(vpage_masked as u32).to_be_bytes()[..3]);
|
||||||
let aad: &[u8] = &[];
|
let aad: &[u8] = &[];
|
||||||
let mut tag = [0u8; size_of::<Tag>()];
|
let mut tag = [0u8; size_of::<Tag>()];
|
||||||
self.ram_spim.mem_read(
|
if !self.ram_spim.mem_read(
|
||||||
(self.swap_mac_start + (src_offset / PAGE_SIZE) * size_of::<Tag>()) as u32,
|
(self.swap_mac_start + (src_offset / PAGE_SIZE) * size_of::<Tag>()) as u32,
|
||||||
&mut tag,
|
&mut tag,
|
||||||
false,
|
false,
|
||||||
);
|
) {
|
||||||
self.ram_spim.mem_read(src_offset as u32, buf, false);
|
writeln!(
|
||||||
|
DebugUart {},
|
||||||
|
"Read timeout of MAC at offset {:x}; data result: {:x?}",
|
||||||
|
(self.swap_mac_start + (src_offset / PAGE_SIZE) * size_of::<Tag>()) as u32,
|
||||||
|
&tag
|
||||||
|
)
|
||||||
|
.ok();
|
||||||
|
}
|
||||||
|
if !self.ram_spim.mem_read(src_offset as u32, buf, false) {
|
||||||
|
writeln!(
|
||||||
|
DebugUart {},
|
||||||
|
"Read timeout of data at offset {:x}; data result: {:x?} .. {:x?}",
|
||||||
|
(self.swap_mac_start + (src_offset / PAGE_SIZE) * size_of::<Tag>()) as u32,
|
||||||
|
&buf[..16],
|
||||||
|
&buf[buf.len() - 16..]
|
||||||
|
)
|
||||||
|
.ok();
|
||||||
|
};
|
||||||
self.cipher.decrypt_in_place_detached(Nonce::from_slice(&nonce), aad, buf, (&tag).into())
|
self.cipher.decrypt_in_place_detached(Nonce::from_slice(&nonce), aad, buf, (&tag).into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue