Skip to main content

Module async_ops

Module async_ops 

Source
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
AsyncOp opcodes 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_id whose user_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 from SYS_ASYNC_ENTER). Returns how many completed.
submit
Submit one IPC v2 SQE (AsyncOp 13–17) for ring_id.