aboutsummaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorHimbeer <himbeer@disroot.org>2024-08-01 18:36:34 +0200
committerHimbeer <himbeer@disroot.org>2024-08-01 18:36:34 +0200
commit6dfd7da31b1a8f71400ee8569c38d2acecfd55e6 (patch)
tree64fa887650701adb45661df97533bf107a3bff6f /static
parentbcc634c8e9d54c7839529473919b76f4b78c1c04 (diff)
Document SRVRE message passing syscalls and errors
Diffstat (limited to 'static')
-rw-r--r--static/md/srvre/kernel/wiki/errors.md2
-rw-r--r--static/md/srvre/kernel/wiki/syscalls.md78
2 files changed, 80 insertions, 0 deletions
diff --git a/static/md/srvre/kernel/wiki/errors.md b/static/md/srvre/kernel/wiki/errors.md
index 7703713..905a315 100644
--- a/static/md/srvre/kernel/wiki/errors.md
+++ b/static/md/srvre/kernel/wiki/errors.md
@@ -70,6 +70,8 @@ library errors) and user-friendly descriptions as well as troubleshooting tips.
| MissingRegAddr | The MMIO base address (second column) of a hardware information (text format) device is missing. This error can only be raised by the `hwi` tool because the kernel doesn't process the text format. |
| MissingRegLen | The MMIO region size (third column) of a hardware information (text format) device is missing. This error can only be raised by the `hwi` tool because the kernel doesn't process the text format. |
| UnknownDevKind | The device kind (first column) of a hardware information (text format) device is invalid. This error can only be raised by the `hwi` tool because the kernel doesn't process the text format. See the [hardware information documentation](/md/srvre/kernel/wiki/hwi.md) for details. |
+| NotJoined | The message passing operation requires the caller to be a member of the specified channel, but it is not. |
+| WouldBlock | The message receiving operation failed because there are no messages to be read. The caller may continuously attempt the operation until a message arrives. |
[Return to Wiki Main Page](/md/srvre/kernel/wiki.md)
diff --git a/static/md/srvre/kernel/wiki/syscalls.md b/static/md/srvre/kernel/wiki/syscalls.md
index 5b2ecaf..8fac920 100644
--- a/static/md/srvre/kernel/wiki/syscalls.md
+++ b/static/md/srvre/kernel/wiki/syscalls.md
@@ -54,6 +54,10 @@ Detailed descriptions follow after the summary table.
| 100005 | [processId](#processid-100005) |
| 100006 | [threadId](#threadid-100006) |
| 100007 | [devicesByKind](#devicesbykind-100007) |
+| 100008 | [join](#join-100008) |
+| 100009 | [leave](#leave-100009) |
+| 100010 | [pass](#pass-100010) |
+| 100011 | [receive](#receive-100011) |
errorName (#100000)
-------------------
@@ -180,6 +184,80 @@ are searched for.
* `devices` is the output array the matching devices are placed in
* `len` is the (maximum) length of the output array
+join (#100008)
+--------------
+
+Signature:
+```
+join(channel: usize) !void
+```
+
+Joins the specified [message passing](/md/srvre/kernel/wiki/msgpass.md) channel
+if permitted, allowing messages to be received. If the calling process is
+already a member of the channel, this is a no-op.
+
+See the message passing documentation for details.
+
+* `channel` is the ID of the channel to join
+
+leave (#100009)
+---------------
+
+Signature:
+```
+leave(channel: usize) void
+```
+
+Leaves the specified [message passing](/md/srvre/kernel/wiki/msgpass.md)
+channel, preventing further messages from being received. If the calling
+process is not a member of the channel, this is a no-op.
+
+See the message passing documentation for details.
+
+* `channel` is the ID of the channel to leave
+
+pass (#100010)
+--------------
+
+Signature:
+```
+pass(channel: usize, receiver: u16, bytes: [*]const u8, len: usize) !void
+```
+
+Passes the provided bytes on the specified channel if permitted. If the
+`receiver` argument is non-zero, only the process with the matching ID will
+receive the message. Otherwise all channel members will receive the message.
+Guarantees that the message is not truncated if the operation finishes
+successfully.
+
+* `channel` is the ID of the channel to pass the message on
+* `receiver` is the ID of the process to unicast the message to or zero for broadcast
+* `bytes` is a pointer to the message payload
+* `len` is the length of the message payload
+
+receive (#100011)
+-----------------
+
+Signature:
+```
+receive(channel: usize, sender: ?*u16, buffer: [*]u8, len: usize) !usize
+```
+
+Writes the most recent message on the specified channel to the provided buffer
+if permitted, returning the length of the message payload. The message is
+truncated if the buffer is not large enough. If `sender` is non-null, the ID of
+the sender process is written to the value it points to in order to enable
+unicast responses. This operation fails if the calling process is not a member
+of the channel (see [join](#join-100008)) or if there are no messages to be
+read (`channel.Error.WouldBlock`). Guarantees that the message has not been
+truncated if the operation finishes successfully and the buffer size was
+sufficient.
+
+* `channel` is the ID of the channel to receive the message from
+* `sender` is an optional pointer used to provide the ID of the sender process to the caller
+* `buffer` is a pointer to the output buffer for the message payload
+* `len` is the length of the output buffer, limiting how many bytes of the message can be read
+
[Return to Wiki Main Page](/md/srvre/kernel/wiki.md)
[Return to Index Page](/md/index.md)