mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-20 09:03:28 +00:00
add arguments to register syscall for handler and state
This commit is contained in:
parent
6806403da8
commit
9008452a36
1 changed files with 4 additions and 8 deletions
|
|
@ -1009,20 +1009,16 @@ pub fn handle_inner(pid: PID, tid: TID, in_irq: bool, call: SysCall) -> SysCallR
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[cfg(feature = "swap")]
|
#[cfg(feature = "swap")]
|
||||||
SysCall::RegisterSwapper(s0, s1, s2, s3) => {
|
SysCall::RegisterSwapper(s0, s1, s2, s3, handler, state) => {
|
||||||
Swap::with_mut(|swap| swap.register_handler(s0, s1, s2, s3))
|
Swap::with_mut(|swap| swap.register_handler(s0, s1, s2, s3, handler, state))
|
||||||
}
|
}
|
||||||
#[cfg(feature = "swap")]
|
#[cfg(feature = "swap")]
|
||||||
SysCall::EvictPage(target_pid, vaddr) => {
|
SysCall::EvictPage(target_pid, vaddr) => {
|
||||||
if pid.get() != 2 {
|
if pid.get() != xous_kernel::SWAPPER_PID {
|
||||||
klog!("Illegal caller"); // only PID 2 can call this
|
klog!("Illegal caller"); // only PID 2 can call this
|
||||||
return Err(xous_kernel::Error::AccessDenied);
|
return Err(xous_kernel::Error::AccessDenied);
|
||||||
}
|
}
|
||||||
let phys_addr = crate::arch::mem::virt_to_phys_pid(target_pid, vaddr as usize);
|
Swap::with_mut(|swap| swap.evict_page(target_pid, vaddr))
|
||||||
match phys_addr {
|
|
||||||
Ok(pa) => Swap::with_mut(|swap| swap.evict_page(target_pid, vaddr, pa)),
|
|
||||||
Err(_) => Err(xous_kernel::Error::BadAddress),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* https://github.com/betrusted-io/xous-core/issues/90
|
/* https://github.com/betrusted-io/xous-core/issues/90
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue