diff --git a/kernel/src/mem.rs b/kernel/src/mem.rs index bf9c27e28..32b9764fd 100644 --- a/kernel/src/mem.rs +++ b/kernel/src/mem.rs @@ -501,23 +501,6 @@ impl MemoryManager { ) } - // /// Transfer ownership of a page without moving it. This is a very - // /// specialized function which should only be used when creating a - // /// brand-new process. - // pub fn move_page_ownership( - // &mut self, - // src_addr: *mut u8, - // src_pid: PID, - // dest_pid: PID, - // ) -> Result<(), xous_kernel::Error> { - // let phys_addr = crate::arch::mem::virt_to_phys(src_addr as usize)?; - // self.claim_release_move( - // phys_addr as *mut usize, - // dest_pid, - // ClaimReleaseMove::Move(src_pid), - // ) - // } - /// Mark the page in the current process as being lent. If the borrow is /// read-only, then additionally remove the "write" bit on it. If the page /// is writable, then remove it from the current process until the borrow is diff --git a/kernel/src/services.rs b/kernel/src/services.rs index 6bd0ad6de..ceaf8947c 100644 --- a/kernel/src/services.rs +++ b/kernel/src/services.rs @@ -568,17 +568,6 @@ impl SystemServices { Ok(()) } - // #[cfg(not(baremetal))] - // pub fn make_callback_to( - // &mut self, - // _pid: PID, - // _pc: *const usize, - // _irq_no: usize, - // _arg: *mut usize, - // ) -> Result<(), xous_kernel::Error> { - // Err(xous_kernel::Error::UnhandledSyscall) - // } - /// Create a stack frame in the specified process and jump to it. /// 1. Pause the current process and switch to the new one /// 2. Save the process state, if it hasn't already been saved @@ -934,11 +923,6 @@ impl SystemServices { panic!("PID {} TID {} was not in a state to be switched from: {:?}", pid, tid, other); } }; - // log_process_update(file!(), line!(), process, old_state); - // klog!( - // "unschedule_thread({}:{}): New state is {:?}", - // pid, tid, process.state - // ); Ok(()) } @@ -950,14 +934,6 @@ impl SystemServices { } } panic!("PID {} TID {} not running: {:?}", pid, tid, process.state); - // match &process.state { - // &ProcessState::Sleeping => false, - // &ProcessState::Ready(_x) => false, - // &ProcessState::Free => false, - // &ProcessState::Running(x) if x & (1 << tid) != 0 => false, - // &ProcessState::Setup(_) => false, - // &ProcessState::Running(_) => true, - // } } pub fn set_thread_result( diff --git a/kernel/src/syscall.rs b/kernel/src/syscall.rs index c317eee6e..d4791cdcf 100644 --- a/kernel/src/syscall.rs +++ b/kernel/src/syscall.rs @@ -709,27 +709,6 @@ pub fn handle_inner(pid: PID, tid: TID, in_irq: bool, call: SysCall) -> SysCallR let range = mm.map_range(phys_ptr, virt_ptr, size.get(), pid, req_flags, MemoryType::Default)?; - // If we're handing back an address in main RAM, zero it out. If - // phys is 0, then the page will be lazily allocated, so we - // don't need to do this. - // if !phys_ptr.is_null() { - // for (phys, virt) in (phys_ptr as usize..range.len()).step_by(PAGE_SIZE).zip( - // (range.as_ptr() as usize..(range.as_ptr() as usize + range.len())) - // .step_by(PAGE_SIZE), - // ) { - // // Zero out the virtual page if it's in main memory - // if mm.is_main_memory(phys as *mut u8) { - // let start = virt as *mut usize; - // for offset in 0..(PAGE_SIZE / core::mem::size_of::()) { - // unsafe { start.add(offset).write_volatile(0) }; - // } - // } - - // // Hand the virtual page to the process - // crate::arch::mem::hand_page_to_user(virt as *mut u8) - // .expect("couldn't hand page to user"); - // } - if !phys_ptr.is_null() { if mm.is_main_memory(phys_ptr) { let range_start = range.as_mut_ptr() as *mut usize;