add arguments for handler and state to registration

This commit is contained in:
bunnie 2024-03-08 04:13:42 +08:00
parent 505dce8343
commit fac6a43b19

View file

@ -510,6 +510,8 @@ pub enum SysCall {
/// ///
/// ## Arguments /// ## Arguments
/// * **sid0**, **sid1**, **sid2**, **sid3**: 128-bit SID as four u32 /// * **sid0**, **sid1**, **sid2**, **sid3**: 128-bit SID as four u32
/// * **handler**: address of the blocking swap handler
/// * **state**: address of the process-local state of the swap handler
/// ///
/// ## Returns /// ## Returns
/// Returns a Scalar5 with raw pointers as follows: /// Returns a Scalar5 with raw pointers as follows:
@ -517,7 +519,7 @@ pub enum SysCall {
/// - `arg2`: A pointer to the SMT /// - `arg2`: A pointer to the SMT
/// - `arg3`: A pointer to the RPT /// - `arg3`: A pointer to the RPT
#[cfg(feature = "swap")] #[cfg(feature = "swap")]
RegisterSwapper(u32, u32, u32, u32), RegisterSwapper(u32, u32, u32, u32, usize, usize),
/// Evict a page. /// Evict a page.
/// ///
@ -878,14 +880,14 @@ impl SysCall {
[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")] #[cfg(feature = "swap")]
SysCall::RegisterSwapper(s0, s1, s2, s3) => [ SysCall::RegisterSwapper(s0, s1, s2, s3, handler, state) => [
SysCallNumber::RegisterSwapper as usize, SysCallNumber::RegisterSwapper as usize,
*s0 as usize, *s0 as usize,
*s1 as usize, *s1 as usize,
*s2 as usize, *s2 as usize,
*s3 as usize, *s3 as usize,
0, *handler,
0, *state,
0, 0,
], ],
#[cfg(feature = "swap")] #[cfg(feature = "swap")]
@ -1040,7 +1042,7 @@ impl SysCall {
} }
#[cfg(feature = "swap")] #[cfg(feature = "swap")]
SysCallNumber::RegisterSwapper => { SysCallNumber::RegisterSwapper => {
SysCall::RegisterSwapper(a1 as u32, a2 as u32, a3 as u32, a3 as u32) SysCall::RegisterSwapper(a1 as u32, a2 as u32, a3 as u32, a3 as u32, a4 as usize, a5 as usize)
} }
#[cfg(feature = "swap")] #[cfg(feature = "swap")]
SysCallNumber::EvictPage => SysCall::EvictPage(pid_from_usize(a1)?, a2 as _), SysCallNumber::EvictPage => SysCall::EvictPage(pid_from_usize(a1)?, a2 as _),