Skip to content

Commit 3e62fb6

Browse files
committed
userspace: doc: document queueing of IPC messages from user threads
Describe how messages sent by user threads are copied to kernel-owned slots, how they are matched for re-send and removal, and that the IPC send queue state is kernel-only with CONFIG_SOF_USERSPACE_LL. Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
1 parent 05a104e commit 3e62fb6

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎src/include/sof/userspace/README.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,16 @@ sending notifications: modules queue messages from `mod_ipc_msg_init()` with
148148
processing errors with `send_resource_notif()`. DP modules have no access to the other IPC
149149
syscalls or to heap, vregion, DMA, DAI or scheduler syscalls.
150150

151+
A message sent by a user thread is never linked into the kernel send queue. `ipc_msg_send()`
152+
copies its header and payload (at most `CONFIG_SOF_IPC_USER_MSG_MAX_SIZE` bytes) once into
153+
one of `CONFIG_SOF_IPC_USER_MSG_SLOTS` kernel-owned slots and queues the slot. The slot is
154+
found again by the address of the user message and the memory domain of the sender, so
155+
sending a queued message again updates the queued copy, and `ipc_msg_list_remove()` only
156+
removes messages of the caller's own domain. `msg->list` and `msg->callback` of a user
157+
message are not used. With `CONFIG_SOF_USERSPACE_LL`, the send queue, its lock and the IPC
158+
processing task are kept in kernel-only `struct ipc_kstate`, not in the user-writable
159+
`struct ipc`; kernel code accesses them with `ipc_ks()`.
160+
151161
The `zephyr/syscall/*.c` files hold the validators in one place per subsystem; the rows marked
152162
**scattered** keep their `z_vrfy_` next to the kernel logic and are the migration targets.
153163

0 commit comments

Comments
 (0)