mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
create swapper syscall entries; implement RegisterSwapper
This commit is contained in:
parent
ab9fe13ac8
commit
496d13b157
1 changed files with 34 additions and 0 deletions
|
|
@ -506,6 +506,18 @@ pub enum SysCall {
|
||||||
#[cfg(feature = "v2p")]
|
#[cfg(feature = "v2p")]
|
||||||
VirtToPhysPid(PID /* Process ID */, usize /* virtual address */),
|
VirtToPhysPid(PID /* Process ID */, usize /* virtual address */),
|
||||||
|
|
||||||
|
/// Registers a swapper.
|
||||||
|
///
|
||||||
|
/// ## Arguments
|
||||||
|
/// * **sid0**, **sid1**, **sid2**, **sid3**: 128-bit SID as four u32
|
||||||
|
///
|
||||||
|
/// ## Returns
|
||||||
|
/// Returns a Scalar5 with raw pointers as follows:
|
||||||
|
/// - `arg1`: A pointer to the SPT
|
||||||
|
/// - `arg2`: A pointer to the SMT
|
||||||
|
/// - `arg3`: A pointer to the RPT
|
||||||
|
RegisterSwapper(u32, u32, u32, u32),
|
||||||
|
|
||||||
/// 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.
|
||||||
Invalid(usize, usize, usize, usize, usize, usize, usize),
|
Invalid(usize, usize, usize, usize, usize, usize, usize),
|
||||||
|
|
@ -556,6 +568,10 @@ pub enum SysCallNumber {
|
||||||
ReplyAndReceiveNext = 41,
|
ReplyAndReceiveNext = 41,
|
||||||
#[cfg(feature = "v2p")]
|
#[cfg(feature = "v2p")]
|
||||||
VirtToPhysPid = 42,
|
VirtToPhysPid = 42,
|
||||||
|
#[cfg(feature = "swap")]
|
||||||
|
RegisterSwapper = 43,
|
||||||
|
#[cfg(feature = "swap")]
|
||||||
|
EvictPage = 44,
|
||||||
Invalid,
|
Invalid,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -606,6 +622,10 @@ impl SysCallNumber {
|
||||||
41 => ReplyAndReceiveNext,
|
41 => ReplyAndReceiveNext,
|
||||||
#[cfg(feature = "v2p")]
|
#[cfg(feature = "v2p")]
|
||||||
42 => VirtToPhysPid,
|
42 => VirtToPhysPid,
|
||||||
|
#[cfg(feature = "swap")]
|
||||||
|
43 => RegisterSwapper,
|
||||||
|
#[cfg(feature = "swap")]
|
||||||
|
44 => EvictPage,
|
||||||
_ => Invalid,
|
_ => Invalid,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -840,6 +860,17 @@ impl SysCall {
|
||||||
SysCall::VirtToPhysPid(pid, vaddr) => {
|
SysCall::VirtToPhysPid(pid, vaddr) => {
|
||||||
[SysCallNumber::VirtToPhysPid as usize, pid.get() as usize, *vaddr, 0, 0, 0, 0, 0]
|
[SysCallNumber::VirtToPhysPid as usize, pid.get() as usize, *vaddr, 0, 0, 0, 0, 0]
|
||||||
}
|
}
|
||||||
|
#[cfg(feature = "swap")]
|
||||||
|
SysCall::RegisterSwapper(s0, s1, s2, s3) => [
|
||||||
|
SysCallNumber::RegisterSwapper as usize,
|
||||||
|
*s0 as usize,
|
||||||
|
*s1 as usize,
|
||||||
|
*s2 as usize,
|
||||||
|
*s3 as usize,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
],
|
||||||
SysCall::Invalid(a1, a2, a3, a4, a5, a6, a7) => {
|
SysCall::Invalid(a1, a2, a3, a4, a5, a6, a7) => {
|
||||||
[SysCallNumber::Invalid as usize, *a1, *a2, *a3, *a4, *a5, *a6, *a7]
|
[SysCallNumber::Invalid as usize, *a1, *a2, *a3, *a4, *a5, *a6, *a7]
|
||||||
}
|
}
|
||||||
|
|
@ -986,6 +1017,9 @@ impl SysCall {
|
||||||
SysCallNumber::ReturnScalar5 => {
|
SysCallNumber::ReturnScalar5 => {
|
||||||
SysCall::ReturnScalar5(MessageSender::from_usize(a1), a2, a3, a4, a5, a6)
|
SysCall::ReturnScalar5(MessageSender::from_usize(a1), a2, a3, a4, a5, a6)
|
||||||
}
|
}
|
||||||
|
SysCallNumber::RegisterSwapper => {
|
||||||
|
SysCall::RegisterSwapper(a1 as u32, a2 as u32, a3 as u32, a3 as u32)
|
||||||
|
}
|
||||||
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