Skip to content

Commit bbfd28b

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 74d4780 commit bbfd28b

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
@@ -150,6 +150,16 @@ sending notifications: modules queue messages from `mod_ipc_msg_init()` with
150150
processing errors with `send_resource_notif()`. DP modules have no access to the other IPC
151151
syscalls or to heap, vregion, DMA, DAI or scheduler syscalls.
152152

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

0 commit comments

Comments
 (0)