mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
xous: add api support for Scalar5
Add syscall and return definitions for Scalar5, as well as ReturnScalar5. This will enable us to pass up to five scalars as a return from a blockingscalar call. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
f861af7620
commit
c8bb039c41
2 changed files with 31 additions and 17 deletions
|
|
@ -460,6 +460,9 @@ pub enum Result {
|
||||||
/// the caller.
|
/// the caller.
|
||||||
NewProcess(ProcessStartup),
|
NewProcess(ProcessStartup),
|
||||||
|
|
||||||
|
/// 20: A scalar with five values
|
||||||
|
Scalar5(usize, usize, usize, usize, usize),
|
||||||
|
|
||||||
UnknownResult(usize, usize, usize, usize, usize, usize, usize),
|
UnknownResult(usize, usize, usize, usize, usize, usize, usize),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -523,6 +526,7 @@ impl Result {
|
||||||
0,
|
0,
|
||||||
],
|
],
|
||||||
Result::NewProcess(p) => Self::add_opcode(19, p.into()),
|
Result::NewProcess(p) => Self::add_opcode(19, p.into()),
|
||||||
|
Result::Scalar5(a, b, c, d, e) => [15, *a, *b, *c, *d, *e, 0, 0],
|
||||||
Result::UnknownResult(arg1, arg2, arg3, arg4, arg5, arg6, arg7) => {
|
Result::UnknownResult(arg1, arg2, arg3, arg4, arg5, arg6, arg7) => {
|
||||||
[usize::MAX, *arg1, *arg2, *arg3, *arg4, *arg5, *arg6, *arg7]
|
[usize::MAX, *arg1, *arg2, *arg3, *arg4, *arg5, *arg6, *arg7]
|
||||||
}
|
}
|
||||||
|
|
@ -600,6 +604,7 @@ impl Result {
|
||||||
17 => Result::None,
|
17 => Result::None,
|
||||||
18 => Result::MemoryReturned(MemorySize::new(src[1]), MemorySize::new(src[2])),
|
18 => Result::MemoryReturned(MemorySize::new(src[1]), MemorySize::new(src[2])),
|
||||||
19 => Result::NewProcess(src.into()),
|
19 => Result::NewProcess(src.into()),
|
||||||
|
20 => Result::Scalar5(src[1], src[2], src[3], src[4], src[5]),
|
||||||
_ => Result::UnknownResult(src[0], src[1], src[2], src[3], src[4], src[5], src[6]),
|
_ => Result::UnknownResult(src[0], src[1], src[2], src[3], src[4], src[5], src[6]),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -468,9 +468,10 @@ pub enum SysCall {
|
||||||
/// ## Errors
|
/// ## Errors
|
||||||
/// * **BadAddress**: The mapping does not exist
|
/// * **BadAddress**: The mapping does not exist
|
||||||
#[cfg(feature = "v2p")]
|
#[cfg(feature = "v2p")]
|
||||||
VirtToPhys(
|
VirtToPhys(usize /* virtual address */),
|
||||||
usize, /* virtual address */
|
|
||||||
),
|
/// Return five scalars to the sender
|
||||||
|
ReturnScalar5(MessageSender, usize, usize, usize, usize, usize),
|
||||||
|
|
||||||
/// This syscall does not exist. It captures all possible
|
/// This syscall does not exist. It captures all possible
|
||||||
/// arguments so detailed analysis can be performed.
|
/// arguments so detailed analysis can be performed.
|
||||||
|
|
@ -518,6 +519,7 @@ pub enum SysCallNumber {
|
||||||
AdjustProcessLimit = 38,
|
AdjustProcessLimit = 38,
|
||||||
#[cfg(feature = "v2p")]
|
#[cfg(feature = "v2p")]
|
||||||
VirtToPhys = 39,
|
VirtToPhys = 39,
|
||||||
|
ReturnScalar5 = 40,
|
||||||
Invalid,
|
Invalid,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -564,6 +566,7 @@ impl SysCallNumber {
|
||||||
38 => AdjustProcessLimit,
|
38 => AdjustProcessLimit,
|
||||||
#[cfg(feature = "v2p")]
|
#[cfg(feature = "v2p")]
|
||||||
39 => VirtToPhys,
|
39 => VirtToPhys,
|
||||||
|
40 => ReturnScalar5,
|
||||||
_ => Invalid,
|
_ => Invalid,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -929,14 +932,17 @@ impl SysCall {
|
||||||
0,
|
0,
|
||||||
],
|
],
|
||||||
#[cfg(feature = "v2p")]
|
#[cfg(feature = "v2p")]
|
||||||
SysCall::VirtToPhys(vaddr) => [
|
SysCall::VirtToPhys(vaddr) => {
|
||||||
SysCallNumber::VirtToPhys as usize,
|
[SysCallNumber::VirtToPhys as usize, *vaddr, 0, 0, 0, 0, 0, 0]
|
||||||
*vaddr,
|
}
|
||||||
0,
|
SysCall::ReturnScalar5(sender, arg1, arg2, arg3, arg4, arg5) => [
|
||||||
0,
|
SysCallNumber::ReturnScalar5 as usize,
|
||||||
0,
|
sender.to_usize(),
|
||||||
0,
|
*arg1,
|
||||||
0,
|
*arg2,
|
||||||
|
*arg3,
|
||||||
|
*arg4,
|
||||||
|
*arg5,
|
||||||
0,
|
0,
|
||||||
],
|
],
|
||||||
SysCall::Invalid(a1, a2, a3, a4, a5, a6, a7) => [
|
SysCall::Invalid(a1, a2, a3, a4, a5, a6, a7) => [
|
||||||
|
|
@ -1105,6 +1111,9 @@ impl SysCall {
|
||||||
SysCallNumber::AdjustProcessLimit => SysCall::AdjustProcessLimit(a1, a2, a3),
|
SysCallNumber::AdjustProcessLimit => SysCall::AdjustProcessLimit(a1, a2, a3),
|
||||||
#[cfg(feature = "v2p")]
|
#[cfg(feature = "v2p")]
|
||||||
SysCallNumber::VirtToPhys => SysCall::VirtToPhys(a1 as _),
|
SysCallNumber::VirtToPhys => SysCall::VirtToPhys(a1 as _),
|
||||||
|
SysCallNumber::ReturnScalar5 => {
|
||||||
|
SysCall::ReturnScalar5(MessageSender::from_usize(a1), a2, a3, a4, a5, a6)
|
||||||
|
}
|
||||||
SysCallNumber::Invalid => SysCall::Invalid(a1, a2, a3, a4, a5, a6, a7),
|
SysCallNumber::Invalid => SysCall::Invalid(a1, a2, a3, a4, a5, a6, a7),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue