summaryrefslogtreecommitdiff
path: root/type.h
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2023-11-24 16:30:40 -0500
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-12-03 01:02:04 +0100
commitc40604042bd6e9f80e4f5fe6bc9deefb29c4b94a (patch)
treea08a664445ecc541fcaaef87d85636f55ad0ce45 /type.h
parentb5a567954ce3b4d236b7a2375a6a00f3a4a853e8 (diff)
x86_64: adapt MiG generated stubs to use mach_port_name_inlined_t for inlined port rights.
For i686, we just change the code to use mach_port_name_inlined_t when defining the types. This is a no-op. For x86_64, there's a few things that are different: - In the server code, the server handler can get inlined ports and the array will be resized and cast as an array of mach_port_name_t. Output parameters have a similar treatment where the inlined array in the output is used as an array of mach_port_name_t but resized to look like a mach_port_name_inlined_t. - In the user side, we follow the same approach. Input ports as arrays of mach_port_name_t are expanded into an array of mach_port_name_inlined_t. Output ports are then converted back into an array of mach_port_name_inlined_t so that they fit into the expected message format. Essentially, regardless of whether port rights are inline or out of line, user interfaces and server stubs always receive an array of port rights, not mach_port_name_inlined_t. However, inlined port rights will be exchanged using mach_port_name_inlined_t. Message-ID: <20231124213041.952886-4-flaviocruz@gmail.com>
Diffstat (limited to 'type.h')
-rw-r--r--type.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/type.h b/type.h
index 1e4e49f..a34c978 100644
--- a/type.h
+++ b/type.h
@@ -133,6 +133,10 @@ typedef enum dealloc {
* itKernelPort is used only on kernel interfaces and is set to true when
* the initial type is mach_port_t, which in turn is actually translated to
* internal port pointers (ipc_port_t).
+ *
+ * itUserlandPort indicates that the field represents a port right (represented
+ * as a port name) and thus will only be true for userland stubs. This is
+ * used to change how inlined port names in messages are generated.
*/
typedef struct ipc_type
@@ -163,6 +167,7 @@ typedef struct ipc_type
bool itString;
bool itVarArray;
bool itIndefinite;
+ bool itUserlandPort;
bool itKernelPort;
struct ipc_type *itElement; /* may be NULL */