mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
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:
parent
8ac141af1b
commit
719549a2cb
3 changed files with 8 additions and 10 deletions
|
|
@ -678,10 +678,8 @@ pub fn handle_inner(pid: PID, tid: TID, call: SysCall) -> SysCallResult {
|
||||||
.map(|_| xous_kernel::Result::Ok)
|
.map(|_| xous_kernel::Result::Ok)
|
||||||
}
|
}
|
||||||
SysCall::Yield => do_yield(pid, tid),
|
SysCall::Yield => do_yield(pid, tid),
|
||||||
SysCall::ReturnToParentI(_pid, _cpuid) => {
|
SysCall::ReturnToParent(_pid, _cpuid) => {
|
||||||
unsafe {
|
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)| {
|
SWITCHTO_CALLER.take().map(|(parent_pid, parent_ctx)| {
|
||||||
crate::arch::irq::set_isr_return_pair(parent_pid, parent_ctx)
|
crate::arch::irq::set_isr_return_pair(parent_pid, parent_ctx)
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ fn timer_tick(_irq_no: usize, _arg: *mut usize) {
|
||||||
//println!(">>> Timer tick");
|
//println!(">>> Timer tick");
|
||||||
let mut timer = CSR::new(TIMER_BASE as *mut u32);
|
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
|
// acknowledge the timer
|
||||||
timer.wfo(utra::timer0::EV_PENDING_PENDING, 0b1);
|
timer.wfo(utra::timer0::EV_PENDING_PENDING, 0b1);
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ pub enum SysCall {
|
||||||
///
|
///
|
||||||
/// * **ProcessNotChild**: The given PID is not a child of the current
|
/// * **ProcessNotChild**: The given PID is not a child of the current
|
||||||
/// process
|
/// process
|
||||||
ReturnToParentI(PID, CpuID),
|
ReturnToParent(PID, CpuID),
|
||||||
|
|
||||||
/// Claims an interrupt and unmasks it immediately. The provided function
|
/// Claims an interrupt and unmasks it immediately. The provided function
|
||||||
/// will be called from within an interrupt context, but using the ordinary
|
/// will be called from within an interrupt context, but using the ordinary
|
||||||
|
|
@ -277,7 +277,7 @@ pub enum SysCall {
|
||||||
pub enum SysCallNumber {
|
pub enum SysCallNumber {
|
||||||
MapMemory = 2,
|
MapMemory = 2,
|
||||||
Yield = 3,
|
Yield = 3,
|
||||||
ReturnToParentI = 4,
|
ReturnToParent = 4,
|
||||||
ClaimInterrupt = 5,
|
ClaimInterrupt = 5,
|
||||||
FreeInterrupt = 6,
|
FreeInterrupt = 6,
|
||||||
SwitchTo = 7,
|
SwitchTo = 7,
|
||||||
|
|
@ -310,7 +310,7 @@ impl SysCallNumber {
|
||||||
match val {
|
match val {
|
||||||
2 => MapMemory,
|
2 => MapMemory,
|
||||||
3 => Yield,
|
3 => Yield,
|
||||||
4 => ReturnToParentI,
|
4 => ReturnToParent,
|
||||||
5 => ClaimInterrupt,
|
5 => ClaimInterrupt,
|
||||||
6 => FreeInterrupt,
|
6 => FreeInterrupt,
|
||||||
7 => SwitchTo,
|
7 => SwitchTo,
|
||||||
|
|
@ -386,8 +386,8 @@ impl SysCall {
|
||||||
0,
|
0,
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
SysCall::ReturnToParentI(a1, a2) => [
|
SysCall::ReturnToParent(a1, a2) => [
|
||||||
SysCallNumber::ReturnToParentI as usize,
|
SysCallNumber::ReturnToParent as usize,
|
||||||
a1.get() as usize,
|
a1.get() as usize,
|
||||||
*a2 as usize,
|
*a2 as usize,
|
||||||
0,
|
0,
|
||||||
|
|
@ -639,7 +639,7 @@ impl SysCall {
|
||||||
SysCallNumber::ReceiveMessage => {
|
SysCallNumber::ReceiveMessage => {
|
||||||
SysCall::ReceiveMessage(SID::from_u32(a1 as _, a2 as _, a3 as _, a4 as _))
|
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(
|
SysCallNumber::ClaimInterrupt => SysCall::ClaimInterrupt(
|
||||||
a1,
|
a1,
|
||||||
MemoryAddress::new(a2).ok_or(Error::InvalidSyscall)?,
|
MemoryAddress::new(a2).ok_or(Error::InvalidSyscall)?,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue