pub fn sys_ipc_send(_endpoint: u64, _msg: &[u8]) -> SyscallResult<()>Expand description
Send a message to an IPC endpoint.
Transmits a message to the specified IPC endpoint. The endpoint is
identified by a capability token that the sender must possess with
WRITE rights. The kernel validates the capability before delivering
the message.
For small messages (64 bytes or fewer), the kernel uses a fast-path register-based transfer achieving sub-microsecond latency. For larger messages, the kernel uses zero-copy delivery by remapping the sender’s pages into the receiver’s address space, avoiding any data copying.
This call blocks until the receiver has accepted the message or until
the endpoint’s send queue has space (for asynchronous endpoints). If the
endpoint is a synchronous rendezvous endpoint, the sender blocks until a
receiver calls sys_ipc_receive on the same endpoint.
§Arguments
endpoint- Capability token identifying the target IPC endpoint. The caller must hold this capability with at leastWRITErights. The token is a 64-bit value obtained from the capability system.msg- Message payload as a byte slice. Must not exceed the endpoint’s maximum message size (default 64 KiB). For optimal performance, keep messages at or below 64 bytes to use the register-based fast path.
§Returns
Ok(())on successful delivery of the message.
§Errors
SyscallError::InvalidArgument-msgexceeds the endpoint’s maximum message size or is empty.SyscallError::PermissionDenied- The caller does not hold the endpoint capability or lacksWRITErights on it.SyscallError::NotFound- The endpoint capability token is invalid or has been revoked.SyscallError::WouldBlock- The endpoint’s send queue is full and non-blocking mode was requested.SyscallError::Timeout- The operation timed out waiting for the receiver.
§Examples
use veridian_kernel::pkg::sdk::syscall_api::sys_ipc_send;
let endpoint: u64 = 0x1234; // capability token for the endpoint
let message = b"hello from sender";
sys_ipc_send(endpoint, message).expect("ipc send failed");