+
+#if CONFIG_REQUIRES_U32_MUNGING
+ /*
+ * The indirect system call interface is vararg based. For armv7k, arm64_32,
+ * and arm64, this means we simply lay the values down on the stack, padded to
+ * a width multiple (4 bytes for armv7k and arm64_32, 8 bytes for arm64).
+ * The arm64(_32) stub for syscall will load this data into the registers and
+ * then trap. This gives us register state that corresponds to what we would
+ * expect from a armv7 task, so in this particular case we need to munge the
+ * arguments.
+ *
+ * TODO: Is there a cleaner way to do this check? What we're actually
+ * interested in is whether the task is arm64_32. We don't appear to guarantee
+ * that uu_proc is populated here, which is why this currently uses the
+ * thread_t.
+ */
+ mungerp = callp->sy_arg_munge32;
+ assert(uthread->uu_thread);
+
+ if (indirect_offset && !ml_thread_is64bit(uthread->uu_thread)) {
+ (*mungerp)(&uthread->uu_arg[0]);
+ }
+#endif
+