fix various typos and annotate Debug derives

This commit is contained in:
bunnie 2024-05-29 02:05:27 +08:00
parent a0fec13016
commit b9856c8f1d
4 changed files with 7 additions and 6 deletions

View file

@ -577,12 +577,12 @@ pub fn syscall(call: SysCall) -> SysCallResult {
let call = crate::SysCall::from_args(nr, a1, a2, a3, a4, a5, a6, a7).unwrap(); let call = crate::SysCall::from_args(nr, a1, a2, a3, a4, a5, a6, a7).unwrap();
let mut xsc_borrowed = xsc.borrow_mut(); let mut xsc_borrowed = xsc.borrow_mut();
let xsc_asmut = xsc_borrowed.as_mut().expect( let xsc_as_mut = xsc_borrowed.as_mut().expect(
"not connected to server (did you forget to create a thread with xous::create_thread()?)", "not connected to server (did you forget to create a thread with xous::create_thread()?)",
); );
loop { loop {
_xous_syscall_to(nr, a1, a2, a3, a4, a5, a6, a7, &call, xsc_asmut); _xous_syscall_to(nr, a1, a2, a3, a4, a5, a6, a7, &call, xsc_as_mut);
_xous_syscall_result(&mut ret, *tid.borrow(), xsc_asmut); _xous_syscall_result(&mut ret, *tid.borrow(), xsc_as_mut);
match ret { match ret {
Result::Error(e) => return Err(e), Result::Error(e) => return Err(e),
Result::RetryCall => (), Result::RetryCall => (),

View file

@ -590,11 +590,11 @@ macro_rules! msg_blocking_scalar_unpack {
} }
#[cfg(feature = "swap")] #[cfg(feature = "swap")]
#[derive(Copy, Clone, PartialEq, Eq)] #[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum AllocAdvice { pub enum AllocAdvice {
/// the PID of the allocation, virtual address in PID space, physical address /// the PID of the allocation, virtual address in PID space, physical address
Allocate(PID, usize, usize), Allocate(PID, usize, usize),
/// the PID of the page freed, virtuall address in PID space, physical address /// the PID of the page freed, virtual address in PID space, physical address
Free(PID, usize, usize), Free(PID, usize, usize),
/// not yet initialized record /// not yet initialized record
Uninit, Uninit,

View file

@ -1,4 +1,5 @@
#[repr(usize)] #[repr(usize)]
#[derive(Debug)]
pub enum Limits { pub enum Limits {
HeapMaximum = 1, HeapMaximum = 1,
HeapSize = 2, HeapSize = 2,

View file

@ -10,7 +10,7 @@ impl MemoryRange {
/// # Safety /// # Safety
/// ///
/// This allows for creating a `MemoryRange` from any arbitrary pointer, /// This allows for creating a `MemoryRange` from any arbitrary pointer,
/// so it is imperitive that this only be used to point to valid, page-aligned /// so it is imperative that this only be used to point to valid, page-aligned
/// ranges. /// ranges.
pub unsafe fn new(addr: usize, size: usize) -> core::result::Result<MemoryRange, Error> { pub unsafe fn new(addr: usize, size: usize) -> core::result::Result<MemoryRange, Error> {
Ok(MemoryRange { Ok(MemoryRange {