feat(ipc): saved replies: SaveReply/ReplySaved (8 per thread, released on thread death, unforgeable); terminal READ saved until Enter (line.rs editor, reader queue), now pinged

This commit is contained in:
2026-10-28 02:09:34 +01:00
parent 3d69c10079
commit d04dcfffa1
19 changed files with 588 additions and 94 deletions

View File

@@ -86,6 +86,19 @@ pub fn reply(words: [usize; 4], cap: Option<Give>) -> Result<()> {
raw(SYS_REPLY, message_regs(0, words, cap)).map(|_| ())
}
/// Keeps the caller this thread owes a reply to, to answer later with
/// `reply_saved` while it receives others; the reply is not pending any
/// more, so nothing answers it in the meantime.
pub fn save_reply() -> Result<types::bounded::SavedReply> {
let r = raw(SYS_SAVE_REPLY, [0; 6])?;
u8::try_from(r[1]).ok().and_then(types::bounded::SavedReply::new).ok_or(Error::InvalidArgument)
}
/// Answers a caller kept with `save_reply`.
pub fn reply_saved(reply: types::bounded::SavedReply, words: [usize; 4], cap: Option<Give>) -> Result<()> {
raw(SYS_REPLY_SAVED, message_regs(usize::from(reply.value()), words, cap)).map(|_| ())
}
/// Replies to the pending `Call` (if any), then receives the next message.
pub fn reply_recv(endpoint: CapSlot, words: [usize; 4], cap: Option<Give>) -> Result<Received> {
raw(