mach_msg_header_t *ikm_header;
};
+#if defined(__i386__) || defined(__arm__)
+#define IKM_SUPPORT_LEGACY 1
+#else
+#define IKM_SUPPORT_LEGACY 0
+#endif
#define IKM_OVERHEAD (sizeof(struct ipc_kmsg))
assert((kmsg)->ikm_next == IKM_BOGUS); \
MACRO_END
+#define ikm_set_header(kmsg, mtsize) \
+MACRO_BEGIN \
+ (kmsg)->ikm_header = (mach_msg_header_t *) \
+ ((vm_offset_t)((kmsg) + 1) + (kmsg)->ikm_size - (mtsize)); \
+MACRO_END
+
struct ipc_kmsg_queue {
struct ipc_kmsg *ikmq_base;
};
extern void ipc_kmsg_destroy_dest(
ipc_kmsg_t kmsg);
-
/* Preallocate a kernel message buffer */
+extern ipc_kmsg_t ipc_kmsg_prealloc(
+ mach_msg_size_t size);
+
+/* bind a preallocated message buffer to a port */
extern void ipc_kmsg_set_prealloc(
ipc_kmsg_t kmsg,
ipc_port_t port);
-/* Clear a kernel message buffer */
+/* Clear preallocated message buffer binding */
extern void ipc_kmsg_clear_prealloc(
ipc_kmsg_t kmsg,
ipc_port_t port);
extern void ipc_kmsg_copyin_from_kernel(
ipc_kmsg_t kmsg);
+#if IKM_SUPPORT_LEGACY
+extern void ipc_kmsg_copyin_from_kernel_legacy(
+ ipc_kmsg_t kmsg);
+#endif
+
/* Copyout port rights in the header of a message */
extern mach_msg_return_t ipc_kmsg_copyout_header(
mach_msg_header_t *msg,
ipc_kmsg_t kmsg,
ipc_space_t space);
+#if IKM_SUPPORT_LEGACY
+extern void ipc_kmsg_copyout_to_kernel_legacy(
+ ipc_kmsg_t kmsg,
+ ipc_space_t space);
+#endif
+
/* get a scatter list and check consistency */
extern mach_msg_body_t *ipc_kmsg_get_scatter(
mach_vm_address_t msg_addr,