[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/11] doc: document message semantics with protected payloads
From: |
Justus Winter |
Subject: |
[PATCH 11/11] doc: document message semantics with protected payloads |
Date: |
Mon, 17 Feb 2014 18:21:01 +0100 |
* doc/mach.texi (Message Receive): Document message semantics with
protected payloads.
---
doc/mach.texi | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/doc/mach.texi b/doc/mach.texi
index 26bf0c6..b3cc2ec 100644
--- a/doc/mach.texi
+++ b/doc/mach.texi
@@ -1949,6 +1949,25 @@ loses the receive right after the message was dequeued
from it, then
right still exists, but isn't held by the caller, then
@code{msgh_local_port} specifies @code{MACH_PORT_NULL}.
+Servers usually associate some state with a receive right. To that
+end, they might use a hash table to look up the state for the port a
+message was sent to. To optimize this, a task may associate an opaque
+@var{payload} with a receive right using the
+@code{mach_port_set_protected_payload} function. Once this is done,
+the kernel will set the @code{msgh_protected_payload} field to
+@var{payload} when delivering a message to this right and indicate
+this by setting the local part of @code{msgh_bits} to
+@code{MACH_MSG_TYPE_PROTECTED_PAYLOAD}.
+
+The support for protected payloads was added to GNU Mach. To preserve
+binary compatibility, the @code{msgh_local_port} and
+@code{msgh_local_port} share the same location. This makes it
+possible to add the payload information without increasing the size of
+@code{mach_msg_header_t}. This is an implementation detail. Which
+field is valid is determined by the local part of the
+@code{msgh_bits}. Existing software is not affected. When a receive
+right is transferred to another task, its payload is cleared.
+
Received messages are stamped with a sequence number, taken from the
port from which the message was received. (Messages received from a
port set are stamped with a sequence number from the appropriate member
--
1.8.5.2
- Re: [PATCH 04/11] doc: document mach_port_set_protected_payload, (continued)
- [PATCH 02/11] ipc: add protected payload, Justus Winter, 2014/02/17
- [PATCH 03/11] ipc: implement mach_port_set_protected_payload, Justus Winter, 2014/02/17
- [PATCH 07/11] include: define MACH_MSG_TYPE_PROTECTED_PAYLOAD, Justus Winter, 2014/02/17
- [PATCH 08/11] doc: document MACH_MSG_TYPE_PROTECTED_PAYLOAD, Justus Winter, 2014/02/17
- [PATCH 06/11] doc: document msgh_protected_payload, Justus Winter, 2014/02/17
- [PATCH 10/11] ipc: clear the payload when moving a receive port, Justus Winter, 2014/02/17
- [PATCH 05/11] include: add msgh_protected_payload to mach_msg_header_t, Justus Winter, 2014/02/17
- [PATCH 11/11] doc: document message semantics with protected payloads,
Justus Winter <=
- [PATCH 09/11] ipc: provide the protected payload in ipc_kmsg_copyout_header, Justus Winter, 2014/02/17
- Re: protected payloads for GNU Mach, Samuel Thibault, 2014/02/19