xous: rename ReturnToParentI -> ReturnToParent

This syscall isn't the only one that can be called from an interrupt
context.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2020-11-01 16:25:27 +08:00
parent 8ac141af1b
commit 719549a2cb
3 changed files with 8 additions and 10 deletions

View file

@ -678,10 +678,8 @@ pub fn handle_inner(pid: PID, tid: TID, call: SysCall) -> SysCallResult {
.map(|_| xous_kernel::Result::Ok)
}
SysCall::Yield => do_yield(pid, tid),
SysCall::ReturnToParentI(_pid, _cpuid) => {
SysCall::ReturnToParent(_pid, _cpuid) => {
unsafe {
// let (_current_pid, _current_ctx) = crate::arch::irq::take_isr_return_pair()
// .expect("couldn't get the isr return pair");
SWITCHTO_CALLER.take().map(|(parent_pid, parent_ctx)| {
crate::arch::irq::set_isr_return_pair(parent_pid, parent_ctx)
});

View file

@ -11,7 +11,7 @@ fn timer_tick(_irq_no: usize, _arg: *mut usize) {
//println!(">>> Timer tick");
let mut timer = CSR::new(TIMER_BASE as *mut u32);
xous::rsyscall(xous::SysCall::ReturnToParentI(xous::PID::new(1).unwrap(), 0)).expect("couldn't return to parent");
xous::rsyscall(xous::SysCall::ReturnToParent(xous::PID::new(1).unwrap(), 0)).expect("couldn't return to parent");
// acknowledge the timer
timer.wfo(utra::timer0::EV_PENDING_PENDING, 0b1);

View file

@ -128,7 +128,7 @@ pub enum SysCall {
///
/// * **ProcessNotChild**: The given PID is not a child of the current
/// process
ReturnToParentI(PID, CpuID),
ReturnToParent(PID, CpuID),
/// Claims an interrupt and unmasks it immediately. The provided function
/// will be called from within an interrupt context, but using the ordinary
@ -277,7 +277,7 @@ pub enum SysCall {
pub enum SysCallNumber {
MapMemory = 2,
Yield = 3,
ReturnToParentI = 4,
ReturnToParent = 4,
ClaimInterrupt = 5,
FreeInterrupt = 6,
SwitchTo = 7,
@ -310,7 +310,7 @@ impl SysCallNumber {
match val {
2 => MapMemory,
3 => Yield,
4 => ReturnToParentI,
4 => ReturnToParent,
5 => ClaimInterrupt,
6 => FreeInterrupt,
7 => SwitchTo,
@ -386,8 +386,8 @@ impl SysCall {
0,
]
}
SysCall::ReturnToParentI(a1, a2) => [
SysCallNumber::ReturnToParentI as usize,
SysCall::ReturnToParent(a1, a2) => [
SysCallNumber::ReturnToParent as usize,
a1.get() as usize,
*a2 as usize,
0,
@ -639,7 +639,7 @@ impl SysCall {
SysCallNumber::ReceiveMessage => {
SysCall::ReceiveMessage(SID::from_u32(a1 as _, a2 as _, a3 as _, a4 as _))
}
SysCallNumber::ReturnToParentI => SysCall::ReturnToParentI(pid_from_usize(a1)?, a2),
SysCallNumber::ReturnToParent => SysCall::ReturnToParent(pid_from_usize(a1)?, a2),
SysCallNumber::ClaimInterrupt => SysCall::ClaimInterrupt(
a1,
MemoryAddress::new(a2).ok_or(Error::InvalidSyscall)?,