mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
xous: add syscall definition for ConnectForProcess
This call allows one process to establish a connection on behalf of another process. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
b094f1147b
commit
06daa06921
1 changed files with 24 additions and 0 deletions
|
|
@ -288,6 +288,11 @@ pub enum SysCall {
|
||||||
/// be created.
|
/// be created.
|
||||||
CreateServer,
|
CreateServer,
|
||||||
|
|
||||||
|
/// Establish a connection in the given process to the given server. This
|
||||||
|
/// call can be used by a nameserver to make server connections without
|
||||||
|
/// disclosing SIDs.
|
||||||
|
ConnectForProcess(PID, SID),
|
||||||
|
|
||||||
/// 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),
|
||||||
|
|
@ -323,6 +328,7 @@ pub enum SysCallNumber {
|
||||||
ReturnScalar2 = 27,
|
ReturnScalar2 = 27,
|
||||||
TryReceiveMessage = 28,
|
TryReceiveMessage = 28,
|
||||||
CreateServer = 29,
|
CreateServer = 29,
|
||||||
|
ConnectForProcess = 30,
|
||||||
Invalid,
|
Invalid,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -358,6 +364,7 @@ impl SysCallNumber {
|
||||||
27 => ReturnScalar2,
|
27 => ReturnScalar2,
|
||||||
28 => TryReceiveMessage,
|
28 => TryReceiveMessage,
|
||||||
29 => CreateServer,
|
29 => CreateServer,
|
||||||
|
30 => ConnectForProcess,
|
||||||
_ => Invalid,
|
_ => Invalid,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -423,6 +430,19 @@ impl SysCall {
|
||||||
0,
|
0,
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
SysCall::ConnectForProcess(pid, sid) => {
|
||||||
|
let s = sid.to_u32();
|
||||||
|
[
|
||||||
|
SysCallNumber::ConnectForProcess as usize,
|
||||||
|
pid.get() as _,
|
||||||
|
s.0 as _,
|
||||||
|
s.1 as _,
|
||||||
|
s.2 as _,
|
||||||
|
s.3 as _,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
]
|
||||||
|
}
|
||||||
SysCall::ReturnToParent(a1, a2) => [
|
SysCall::ReturnToParent(a1, a2) => [
|
||||||
SysCallNumber::ReturnToParent as usize,
|
SysCallNumber::ReturnToParent as usize,
|
||||||
a1.get() as usize,
|
a1.get() as usize,
|
||||||
|
|
@ -832,6 +852,10 @@ impl SysCall {
|
||||||
SysCallNumber::ReturnScalar2 => {
|
SysCallNumber::ReturnScalar2 => {
|
||||||
SysCall::ReturnScalar2(MessageSender::from_usize(a1), a2, a3)
|
SysCall::ReturnScalar2(MessageSender::from_usize(a1), a2, a3)
|
||||||
}
|
}
|
||||||
|
SysCallNumber::ConnectForProcess => SysCall::ConnectForProcess(
|
||||||
|
PID::new(a1 as _).ok_or(Error::InvalidSyscall)?,
|
||||||
|
SID::from_u32(a2 as _, a3 as _, a4 as _, a5 as _),
|
||||||
|
),
|
||||||
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