summaryrefslogtreecommitdiff
path: root/routine.c
diff options
context:
space:
mode:
authorFlavio Cruz <flaviocruz@gmail.com>2023-12-14 01:02:30 -0500
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2023-12-17 22:21:41 +0100
commit3b1fcb2b83bb26d43dc912884499345f561d0b6a (patch)
tree7b28fbca37cbe9cc0838e82e0ca15b82e09d3708 /routine.c
parenta6a6afc285f8f4a1aadc8857ac980b62010ce004 (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.
Diffstat (limited to 'routine.c')
-rw-r--r--routine.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/routine.c b/routine.c
index 3ae9298..8909f4d 100644
--- a/routine.c
+++ b/routine.c
@@ -517,6 +517,12 @@ rtAugmentArgKind(argument_t *arg)
{
arg->argKind = akAddFeature(arg->argKind, akbPointer);
}
+ if (akCheck(arg->argKind, akbSendRcv) &&
+ IS_64BIT_ABI &&
+ it->itUserlandPort &&
+ akCheck(arg->argKind, akbIndefinite)) {
+ arg->argKind = akAddFeature(arg->argKind, akbPointer);
+ }
}
/* arg->argType may be NULL in this function */