Skip to content

Commit

Permalink
std: xous: pass entire memory range to flag updater
Browse files Browse the repository at this point in the history
When updating memory flags via `update_memory_flags()`, ensure we
multiply the slice length by the element size to get the full memory
size.

Signed-off-by: Sean Cross <[email protected]>
  • Loading branch information
xobs committed Jan 13, 2024
1 parent 626926f commit f732d2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/std/src/os/xous/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 452,7 @@ pub(crate) unsafe fn update_memory_flags<T>(
) -> Result<(), Error> {
let mut a0 = Syscall::UpdateMemoryFlags as usize;
let mut a1 = range.as_mut_ptr() as usize;
let a2 = range.len();
let a2 = range.len() * core::mem::size_of::<T>();
let a3 = new_flags.bits();
let a4 = 0; // Process ID is currently None
let a5 = 0;
Expand Down

0 comments on commit f732d2b

Please sign in to comment.