mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
kernel: mem: fix remaining clippy lints
Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
d27a2eb27e
commit
c7ff0ceb21
1 changed files with 11 additions and 13 deletions
|
|
@ -28,7 +28,7 @@ impl fmt::Display for MemoryRangeExtra {
|
||||||
write!(
|
write!(
|
||||||
f,
|
f,
|
||||||
"{}{}{}{} - ({:08x}) {:08x} - {:08x} {} bytes",
|
"{}{}{}{} - ({:08x}) {:08x} - {:08x} {} bytes",
|
||||||
((self.mem_tag >> 0) & 0xff) as u8 as char,
|
((self.mem_tag) & 0xff) as u8 as char,
|
||||||
((self.mem_tag >> 8) & 0xff) as u8 as char,
|
((self.mem_tag >> 8) & 0xff) as u8 as char,
|
||||||
((self.mem_tag >> 16) & 0xff) as u8 as char,
|
((self.mem_tag >> 16) & 0xff) as u8 as char,
|
||||||
((self.mem_tag >> 24) & 0xff) as u8 as char,
|
((self.mem_tag >> 24) & 0xff) as u8 as char,
|
||||||
|
|
@ -413,7 +413,7 @@ impl MemoryManager {
|
||||||
// FIXME: Un-reserve addresses if we encounter an error here
|
// FIXME: Un-reserve addresses if we encounter an error here
|
||||||
mm.reserve_address(self, virt, flags)?;
|
mm.reserve_address(self, virt, flags)?;
|
||||||
}
|
}
|
||||||
Ok(unsafe { xous_kernel::MemoryRange::new(virt_ptr as usize, size) }?)
|
unsafe { xous_kernel::MemoryRange::new(virt_ptr as usize, size) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Attempt to allocate a single page from the default section.
|
/// Attempt to allocate a single page from the default section.
|
||||||
|
|
@ -517,7 +517,7 @@ impl MemoryManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(unsafe { MemoryRange::new(virt as usize, size) }?)
|
unsafe { MemoryRange::new(virt as usize, size) }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Attempt to map the given physical address into the virtual address space
|
/// Attempt to map the given physical address into the virtual address space
|
||||||
|
|
@ -547,10 +547,10 @@ impl MemoryManager {
|
||||||
let phys_addr = crate::arch::mem::virt_to_phys(src_addr as usize)?;
|
let phys_addr = crate::arch::mem::virt_to_phys(src_addr as usize)?;
|
||||||
crate::arch::mem::move_page_inner(
|
crate::arch::mem::move_page_inner(
|
||||||
self,
|
self,
|
||||||
&src_mapping,
|
src_mapping,
|
||||||
src_addr,
|
src_addr,
|
||||||
dest_pid,
|
dest_pid,
|
||||||
&dest_mapping,
|
dest_mapping,
|
||||||
dest_addr,
|
dest_addr,
|
||||||
)?;
|
)?;
|
||||||
self.claim_release_move(
|
self.claim_release_move(
|
||||||
|
|
@ -579,10 +579,10 @@ impl MemoryManager {
|
||||||
// the page while it's borrowed.
|
// the page while it's borrowed.
|
||||||
crate::arch::mem::lend_page_inner(
|
crate::arch::mem::lend_page_inner(
|
||||||
self,
|
self,
|
||||||
&src_mapping,
|
src_mapping,
|
||||||
src_addr as _,
|
src_addr as _,
|
||||||
dest_pid,
|
dest_pid,
|
||||||
&dest_mapping,
|
dest_mapping,
|
||||||
dest_addr as _,
|
dest_addr as _,
|
||||||
mutable,
|
mutable,
|
||||||
)
|
)
|
||||||
|
|
@ -603,10 +603,10 @@ impl MemoryManager {
|
||||||
// the page while it's borrowed.
|
// the page while it's borrowed.
|
||||||
crate::arch::mem::return_page_inner(
|
crate::arch::mem::return_page_inner(
|
||||||
self,
|
self,
|
||||||
&src_mapping,
|
src_mapping,
|
||||||
src_addr,
|
src_addr,
|
||||||
dest_pid,
|
dest_pid,
|
||||||
&dest_mapping,
|
dest_mapping,
|
||||||
dest_addr,
|
dest_addr,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
@ -674,10 +674,8 @@ impl MemoryManager {
|
||||||
let addr = addr as usize;
|
let addr = addr as usize;
|
||||||
|
|
||||||
// Ensure the address lies on a page boundary
|
// Ensure the address lies on a page boundary
|
||||||
if cfg!(baremetal) {
|
if cfg!(baremetal) && addr & 0xfff != 0 {
|
||||||
if addr & 0xfff != 0 {
|
return Err(xous_kernel::Error::BadAlignment);
|
||||||
return Err(xous_kernel::Error::BadAlignment);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut offset = 0;
|
let mut offset = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue