Expand description
IPC v2 operations on async rings: AsyncOp 13–17 (spec §11).
§Execution model
Every operation, at submission and at every retry, runs in the ring
owner’s context: SYS_ASYNC_ENTER is only accepted from the owning
process, and both submit and poll are called from it. All user
copies therefore target the owner’s address space, outside any IPC lock;
nothing is ever written from a peer’s context (the defect of the v1
AsyncRing reply path).
An operation that cannot complete without blocking is parked. IPC events
(enqueue, dequeue, reply, cancellation, signal, close) call
notify_event, which kicks every ring that has parked operations; the
owner’s SYS_ASYNC_ENTER then calls poll, which retries them
non-blockingly and posts a CQE for each one that completes.
Re-exports§
use super::endpoint;🔒use super::endpoint::CallSlot;🔒use super::endpoint::CallState;🔒use crate::async_io::complete::push_completion;🔒use crate::async_io::ring::find_ring;🔒use crate::process::process::Process;🔒use crate::sync::SpinLock;🔒use crate::syscall::error::SyscallError;🔒use crate::syscall::ipc_v2 as sys;🔒use crate::syscall::ipc_v2::WaitSpec;🔒use alloc::sync::Arc;🔒use alloc::vec::Vec;🔒use core::mem::size_of;🔒use core::sync::atomic::AtomicUsize;🔒use core::sync::atomic::Ordering;🔒use strat9_abi::ipc_v2::MsgBuf;🔒use strat9_abi::ipc_v2::MsgCall;🔒use strat9_abi::ipc_v2::IPC_NONBLOCK;🔒
Structs§
- Parked 🔒
Enums§
- Attempt 🔒
- Result of one non-blocking attempt.
- Kind 🔒
- What a parked operation is waiting for.
- Submitted
- Submission outcome reported to the async dispatcher.
Constants§
- NONBLOCK 🔒
- OP_
EP_ CALL - OP_
EP_ RECV - OP_
EP_ REPLY - OP_
EP_ SEND AsyncOpopcodes owned by this module.- OP_
NOTIF_ WAIT
Statics§
- PARKED 🔒
- PARKED_
COUNT 🔒 - Fast path for
notify_event: no lock when nothing is parked.
Functions§
- attempt 🔒
- cancel
- Cancel the parked operation of
ring_idwhoseuser_data == target. - drop_
ring - Drop every parked operation of a destroyed ring. Pending calls are abandoned so a late reply’s capabilities are released (§6.2).
- errno 🔒
- finished 🔒
- notify_
event - An IPC v2 event happened: kick every ring that has parked operations.
- poll
- Retry the parked operations of
ring_id. Must run in the ring owner’s context (called fromSYS_ASYNC_ENTER). Returns how many completed. - submit
- Submit one IPC v2 SQE (
AsyncOp13–17) forring_id.