summaryrefslogtreecommitdiff
path: root/ipc/ipc_kmsg.c
diff options
context:
space:
mode:
Diffstat (limited to 'ipc/ipc_kmsg.c')
-rw-r--r--ipc/ipc_kmsg.c345
1 files changed, 156 insertions, 189 deletions
diff --git a/ipc/ipc_kmsg.c b/ipc/ipc_kmsg.c
index c2689a48..5076809e 100644
--- a/ipc/ipc_kmsg.c
+++ b/ipc/ipc_kmsg.c
@@ -50,7 +50,6 @@
#include <vm/vm_user.h>
#include <ipc/port.h>
#include <ipc/ipc_entry.h>
-#include <ipc/ipc_hash.h>
#include <ipc/ipc_kmsg.h>
#include <ipc/ipc_thread.h>
#include <ipc/ipc_marequest.h>
@@ -66,12 +65,9 @@
#if MACH_KDB
#include <ddb/db_output.h>
+#include <ipc/ipc_print.h>
#endif
-extern int copyinmap();
-extern int copyoutmap();
-void ipc_msg_print(); /* forward */
-
#define is_misaligned(x) ( ((vm_offset_t)(x)) & (sizeof(vm_offset_t)-1) )
#define ptr_align(x) \
( ( ((vm_offset_t)(x)) + (sizeof(vm_offset_t)-1) ) & ~(sizeof(vm_offset_t)-1) )
@@ -142,9 +138,7 @@ ipc_kmsg_rmqueue(
next->ikm_prev = prev;
prev->ikm_next = next;
}
- /* XXX Temporary debug logic */
- kmsg->ikm_next = IKM_BOGUS;
- kmsg->ikm_prev = IKM_BOGUS;
+ ikm_mark_bogus (kmsg);
}
/*
@@ -221,9 +215,9 @@ ipc_kmsg_destroy(
*/
void
-ipc_kmsg_clean_body(saddr, eaddr)
- vm_offset_t saddr;
- vm_offset_t eaddr;
+ipc_kmsg_clean_body(
+ vm_offset_t saddr,
+ vm_offset_t eaddr)
{
while (saddr < eaddr) {
mach_msg_type_long_t *type;
@@ -320,8 +314,7 @@ ipc_kmsg_clean_body(saddr, eaddr)
*/
void
-ipc_kmsg_clean(kmsg)
- ipc_kmsg_t kmsg;
+ipc_kmsg_clean(ipc_kmsg_t kmsg)
{
ipc_marequest_t marequest;
ipc_object_t object;
@@ -364,11 +357,11 @@ ipc_kmsg_clean(kmsg)
*/
void
-ipc_kmsg_clean_partial(kmsg, eaddr, dolast, number)
- ipc_kmsg_t kmsg;
- vm_offset_t eaddr;
- boolean_t dolast;
- mach_msg_type_number_t number;
+ipc_kmsg_clean_partial(
+ ipc_kmsg_t kmsg,
+ vm_offset_t eaddr,
+ boolean_t dolast,
+ mach_msg_type_number_t number)
{
ipc_object_t object;
mach_msg_bits_t mbits = kmsg->ikm_header.msgh_bits;
@@ -469,8 +462,7 @@ xxx: type = (mach_msg_type_long_t *) eaddr;
*/
void
-ipc_kmsg_free(kmsg)
- ipc_kmsg_t kmsg;
+ipc_kmsg_free(ipc_kmsg_t kmsg)
{
vm_size_t size = kmsg->ikm_size;
@@ -503,10 +495,10 @@ ipc_kmsg_free(kmsg)
*/
mach_msg_return_t
-ipc_kmsg_get(msg, size, kmsgp)
- mach_msg_header_t *msg;
- mach_msg_size_t size;
- ipc_kmsg_t *kmsgp;
+ipc_kmsg_get(
+ mach_msg_header_t *msg,
+ mach_msg_size_t size,
+ ipc_kmsg_t *kmsgp)
{
ipc_kmsg_t kmsg;
@@ -555,10 +547,10 @@ ipc_kmsg_get(msg, size, kmsgp)
*/
extern mach_msg_return_t
-ipc_kmsg_get_from_kernel(msg, size, kmsgp)
- mach_msg_header_t *msg;
- mach_msg_size_t size;
- ipc_kmsg_t *kmsgp;
+ipc_kmsg_get_from_kernel(
+ mach_msg_header_t *msg,
+ mach_msg_size_t size,
+ ipc_kmsg_t *kmsgp)
{
ipc_kmsg_t kmsg;
@@ -592,10 +584,10 @@ ipc_kmsg_get_from_kernel(msg, size, kmsgp)
*/
mach_msg_return_t
-ipc_kmsg_put(msg, kmsg, size)
- mach_msg_header_t *msg;
- ipc_kmsg_t kmsg;
- mach_msg_size_t size;
+ipc_kmsg_put(
+ mach_msg_header_t *msg,
+ ipc_kmsg_t kmsg,
+ mach_msg_size_t size)
{
mach_msg_return_t mr;
@@ -677,10 +669,10 @@ ipc_kmsg_put_to_kernel(
*/
mach_msg_return_t
-ipc_kmsg_copyin_header(msg, space, notify)
- mach_msg_header_t *msg;
- ipc_space_t space;
- mach_port_t notify;
+ipc_kmsg_copyin_header(
+ mach_msg_header_t *msg,
+ ipc_space_t space,
+ mach_port_t notify)
{
mach_msg_bits_t mbits = msg->msgh_bits &~ MACH_MSGH_BITS_CIRCULAR;
mach_port_t dest_name = msg->msgh_remote_port;
@@ -705,24 +697,14 @@ ipc_kmsg_copyin_header(msg, space, notify)
if (!space->is_active)
goto abort_async;
- /* optimized ipc_entry_lookup */
-
- {
- mach_port_index_t index = MACH_PORT_INDEX(dest_name);
- mach_port_gen_t gen = MACH_PORT_GEN(dest_name);
-
- if (index >= space->is_table_size)
+ entry = ipc_entry_lookup (space, dest_name);
+ if (entry == IE_NULL)
goto abort_async;
-
- entry = &space->is_table[index];
bits = entry->ie_bits;
- /* check generation number and type bit */
-
- if ((bits & (IE_BITS_GEN_MASK|MACH_PORT_TYPE_SEND)) !=
- (gen | MACH_PORT_TYPE_SEND))
+ /* check type bits */
+ if (IE_BITS_TYPE (bits) != MACH_PORT_TYPE_SEND)
goto abort_async;
- }
/* optimized ipc_right_copyin */
@@ -757,8 +739,6 @@ ipc_kmsg_copyin_header(msg, space, notify)
case MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND,
MACH_MSG_TYPE_MAKE_SEND_ONCE): {
- ipc_entry_num_t size;
- ipc_entry_t table;
ipc_entry_t entry;
ipc_entry_bits_t bits;
ipc_port_t dest_port, reply_port;
@@ -769,51 +749,28 @@ ipc_kmsg_copyin_header(msg, space, notify)
if (!space->is_active)
goto abort_request;
- size = space->is_table_size;
- table = space->is_table;
-
- /* optimized ipc_entry_lookup of dest_name */
-
- {
- mach_port_index_t index = MACH_PORT_INDEX(dest_name);
- mach_port_gen_t gen = MACH_PORT_GEN(dest_name);
-
- if (index >= size)
+ entry = ipc_entry_lookup (space, dest_name);
+ if (entry == IE_NULL)
goto abort_request;
-
- entry = &table[index];
bits = entry->ie_bits;
- /* check generation number and type bit */
-
- if ((bits & (IE_BITS_GEN_MASK|MACH_PORT_TYPE_SEND)) !=
- (gen | MACH_PORT_TYPE_SEND))
+ /* check type bits */
+ if (IE_BITS_TYPE (bits) != MACH_PORT_TYPE_SEND)
goto abort_request;
- }
assert(IE_BITS_UREFS(bits) > 0);
dest_port = (ipc_port_t) entry->ie_object;
assert(dest_port != IP_NULL);
- /* optimized ipc_entry_lookup of reply_name */
-
- {
- mach_port_index_t index = MACH_PORT_INDEX(reply_name);
- mach_port_gen_t gen = MACH_PORT_GEN(reply_name);
-
- if (index >= size)
+ entry = ipc_entry_lookup (space, reply_name);
+ if (entry == IE_NULL)
goto abort_request;
-
- entry = &table[index];
bits = entry->ie_bits;
- /* check generation number and type bit */
-
- if ((bits & (IE_BITS_GEN_MASK|MACH_PORT_TYPE_RECEIVE)) !=
- (gen | MACH_PORT_TYPE_RECEIVE))
+ /* check type bits */
+ if (IE_BITS_TYPE (bits) != MACH_PORT_TYPE_RECEIVE)
goto abort_request;
- }
reply_port = (ipc_port_t) entry->ie_object;
assert(reply_port != IP_NULL);
@@ -860,9 +817,6 @@ ipc_kmsg_copyin_header(msg, space, notify)
}
case MACH_MSGH_BITS(MACH_MSG_TYPE_MOVE_SEND_ONCE, 0): {
- mach_port_index_t index;
- mach_port_gen_t gen;
- ipc_entry_t table;
ipc_entry_t entry;
ipc_entry_bits_t bits;
ipc_port_t dest_port;
@@ -876,24 +830,13 @@ ipc_kmsg_copyin_header(msg, space, notify)
if (!space->is_active)
goto abort_reply;
- /* optimized ipc_entry_lookup */
-
- table = space->is_table;
-
- index = MACH_PORT_INDEX(dest_name);
- gen = MACH_PORT_GEN(dest_name);
-
- if (index >= space->is_table_size)
+ entry = ipc_entry_lookup (space, dest_name);
+ if (entry == IE_NULL)
goto abort_reply;
-
- entry = &table[index];
bits = entry->ie_bits;
- /* check generation number, collision bit, and type bit */
-
- if ((bits & (IE_BITS_GEN_MASK|IE_BITS_COLLISION|
- MACH_PORT_TYPE_SEND_ONCE)) !=
- (gen | MACH_PORT_TYPE_SEND_ONCE))
+ /* check and type bits */
+ if (IE_BITS_TYPE (bits) != MACH_PORT_TYPE_SEND_ONCE)
goto abort_reply;
/* optimized ipc_right_copyin */
@@ -917,12 +860,8 @@ ipc_kmsg_copyin_header(msg, space, notify)
assert(dest_port->ip_sorights > 0);
ip_unlock(dest_port);
- /* optimized ipc_entry_dealloc */
-
- entry->ie_next = table->ie_next;
- table->ie_next = index;
- entry->ie_bits = gen;
entry->ie_object = IO_NULL;
+ ipc_entry_dealloc (space, dest_name, entry);
is_write_unlock(space);
msg->msgh_bits = (MACH_MSGH_BITS_OTHER(mbits) |
@@ -1342,10 +1281,10 @@ ipc_kmsg_copyin_header(msg, space, notify)
}
mach_msg_return_t
-ipc_kmsg_copyin_body(kmsg, space, map)
- ipc_kmsg_t kmsg;
- ipc_space_t space;
- vm_map_t map;
+ipc_kmsg_copyin_body(
+ ipc_kmsg_t kmsg,
+ ipc_space_t space,
+ vm_map_t map)
{
ipc_object_t dest;
vm_offset_t saddr, eaddr;
@@ -1562,11 +1501,11 @@ ipc_kmsg_copyin_body(kmsg, space, map)
*/
mach_msg_return_t
-ipc_kmsg_copyin(kmsg, space, map, notify)
- ipc_kmsg_t kmsg;
- ipc_space_t space;
- vm_map_t map;
- mach_port_t notify;
+ipc_kmsg_copyin(
+ ipc_kmsg_t kmsg,
+ ipc_space_t space,
+ vm_map_t map,
+ mach_port_t notify)
{
mach_msg_return_t mr;
@@ -1597,8 +1536,7 @@ ipc_kmsg_copyin(kmsg, space, map, notify)
*/
void
-ipc_kmsg_copyin_from_kernel(
- ipc_kmsg_t kmsg)
+ipc_kmsg_copyin_from_kernel(ipc_kmsg_t kmsg)
{
mach_msg_bits_t bits = kmsg->ikm_header.msgh_bits;
mach_msg_type_name_t rname = MACH_MSGH_BITS_REMOTE(bits);
@@ -1757,10 +1695,10 @@ ipc_kmsg_copyin_from_kernel(
*/
mach_msg_return_t
-ipc_kmsg_copyout_header(msg, space, notify)
- mach_msg_header_t *msg;
- ipc_space_t space;
- mach_port_t notify;
+ipc_kmsg_copyout_header(
+ mach_msg_header_t *msg,
+ ipc_space_t space,
+ mach_port_t notify)
{
mach_msg_bits_t mbits = msg->msgh_bits;
ipc_port_t dest = (ipc_port_t) msg->msgh_remote_port;
@@ -1774,6 +1712,7 @@ ipc_kmsg_copyout_header(msg, space, notify)
case MACH_MSGH_BITS(MACH_MSG_TYPE_PORT_SEND, 0): {
mach_port_t dest_name;
ipc_port_t nsrequest;
+ unsigned long payload;
/* receiving an asynchronous message */
@@ -1792,6 +1731,7 @@ ipc_kmsg_copyout_header(msg, space, notify)
dest_name = dest->ip_receiver_name;
else
dest_name = MACH_PORT_NULL;
+ payload = dest->ip_protected_payload;
if ((--dest->ip_srights == 0) &&
((nsrequest = dest->ip_nsrequest) != IP_NULL)) {
@@ -1805,21 +1745,27 @@ ipc_kmsg_copyout_header(msg, space, notify)
} else
ip_unlock(dest);
- msg->msgh_bits = (MACH_MSGH_BITS_OTHER(mbits) |
- MACH_MSGH_BITS(0, MACH_MSG_TYPE_PORT_SEND));
- msg->msgh_local_port = dest_name;
+ if (! ipc_port_flag_protected_payload(dest)) {
+ msg->msgh_bits = (MACH_MSGH_BITS_OTHER(mbits) |
+ MACH_MSGH_BITS(0, MACH_MSG_TYPE_PORT_SEND));
+ msg->msgh_local_port = dest_name;
+ } else {
+ msg->msgh_bits = (MACH_MSGH_BITS_OTHER(mbits) |
+ MACH_MSGH_BITS(
+ 0, MACH_MSG_TYPE_PROTECTED_PAYLOAD));
+ msg->msgh_protected_payload = payload;
+ }
msg->msgh_remote_port = MACH_PORT_NULL;
return MACH_MSG_SUCCESS;
}
case MACH_MSGH_BITS(MACH_MSG_TYPE_PORT_SEND,
MACH_MSG_TYPE_PORT_SEND_ONCE): {
- ipc_entry_t table;
- mach_port_index_t index;
ipc_entry_t entry;
ipc_port_t reply = (ipc_port_t) msg->msgh_local_port;
mach_port_t dest_name, reply_name;
ipc_port_t nsrequest;
+ unsigned long payload;
/* receiving a request message */
@@ -1827,8 +1773,7 @@ ipc_kmsg_copyout_header(msg, space, notify)
break;
is_write_lock(space);
- if (!space->is_active ||
- ((index = (table = space->is_table)->ie_next) == 0)) {
+ if (!space->is_active || space->is_free_list == NULL) {
is_write_unlock(space);
break;
}
@@ -1858,11 +1803,14 @@ ipc_kmsg_copyout_header(msg, space, notify)
assert(reply->ip_sorights > 0);
ip_unlock(reply);
- /* optimized ipc_entry_get */
-
- entry = &table[index];
- table->ie_next = entry->ie_next;
- entry->ie_request = 0;
+ kern_return_t kr;
+ kr = ipc_entry_get (space, &reply_name, &entry);
+ if (kr) {
+ ip_unlock(reply);
+ ip_unlock(dest);
+ is_write_unlock(space);
+ break;
+ }
{
mach_port_gen_t gen;
@@ -1870,8 +1818,6 @@ ipc_kmsg_copyout_header(msg, space, notify)
assert((entry->ie_bits &~ IE_BITS_GEN_MASK) == 0);
gen = entry->ie_bits + IE_BITS_GEN_ONE;
- reply_name = MACH_PORT_MAKE(index, gen);
-
/* optimized ipc_right_copyout */
entry->ie_bits = gen | (MACH_PORT_TYPE_SEND_ONCE | 1);
@@ -1890,6 +1836,7 @@ ipc_kmsg_copyout_header(msg, space, notify)
dest_name = dest->ip_receiver_name;
else
dest_name = MACH_PORT_NULL;
+ payload = dest->ip_protected_payload;
if ((--dest->ip_srights == 0) &&
((nsrequest = dest->ip_nsrequest) != IP_NULL)) {
@@ -1903,16 +1850,24 @@ ipc_kmsg_copyout_header(msg, space, notify)
} else
ip_unlock(dest);
- msg->msgh_bits = (MACH_MSGH_BITS_OTHER(mbits) |
- MACH_MSGH_BITS(MACH_MSG_TYPE_PORT_SEND_ONCE,
- MACH_MSG_TYPE_PORT_SEND));
- msg->msgh_local_port = dest_name;
+ if (! ipc_port_flag_protected_payload(dest)) {
+ msg->msgh_bits = (MACH_MSGH_BITS_OTHER(mbits) |
+ MACH_MSGH_BITS(MACH_MSG_TYPE_PORT_SEND_ONCE,
+ MACH_MSG_TYPE_PORT_SEND));
+ msg->msgh_local_port = dest_name;
+ } else {
+ msg->msgh_bits = (MACH_MSGH_BITS_OTHER(mbits) |
+ MACH_MSGH_BITS(MACH_MSG_TYPE_PORT_SEND_ONCE,
+ MACH_MSG_TYPE_PROTECTED_PAYLOAD));
+ msg->msgh_protected_payload = payload;
+ }
msg->msgh_remote_port = reply_name;
return MACH_MSG_SUCCESS;
}
case MACH_MSGH_BITS(MACH_MSG_TYPE_PORT_SEND_ONCE, 0): {
mach_port_t dest_name;
+ unsigned long payload;
/* receiving a reply message */
@@ -1926,6 +1881,8 @@ ipc_kmsg_copyout_header(msg, space, notify)
assert(dest->ip_sorights > 0);
+ payload = dest->ip_protected_payload;
+
if (dest->ip_receiver == space) {
ip_release(dest);
dest->ip_sorights--;
@@ -1938,9 +1895,17 @@ ipc_kmsg_copyout_header(msg, space, notify)
dest_name = MACH_PORT_NULL;
}
- msg->msgh_bits = (MACH_MSGH_BITS_OTHER(mbits) |
- MACH_MSGH_BITS(0, MACH_MSG_TYPE_PORT_SEND_ONCE));
- msg->msgh_local_port = dest_name;
+ if (! ipc_port_flag_protected_payload(dest)) {
+ msg->msgh_bits = (MACH_MSGH_BITS_OTHER(mbits) |
+ MACH_MSGH_BITS(0,
+ MACH_MSG_TYPE_PORT_SEND_ONCE));
+ msg->msgh_local_port = dest_name;
+ } else {
+ msg->msgh_bits = (MACH_MSGH_BITS_OTHER(mbits) |
+ MACH_MSGH_BITS(0,
+ MACH_MSG_TYPE_PROTECTED_PAYLOAD));
+ msg->msgh_protected_payload = payload;
+ }
msg->msgh_remote_port = MACH_PORT_NULL;
return MACH_MSG_SUCCESS;
}
@@ -1956,6 +1921,7 @@ ipc_kmsg_copyout_header(msg, space, notify)
mach_msg_type_name_t reply_type = MACH_MSGH_BITS_LOCAL(mbits);
ipc_port_t reply = (ipc_port_t) msg->msgh_local_port;
mach_port_t dest_name, reply_name;
+ unsigned long payload;
if (IP_VALID(reply)) {
ipc_port_t notify_port;
@@ -2036,28 +2002,20 @@ ipc_kmsg_copyout_header(msg, space, notify)
goto copyout_dest;
}
- kr = ipc_entry_get(space, &reply_name, &entry);
+ kr = ipc_entry_alloc(space, &reply_name, &entry);
if (kr != KERN_SUCCESS) {
ip_unlock(reply);
if (notify_port != IP_NULL)
ipc_port_release_sonce(notify_port);
- /* space is locked */
- kr = ipc_entry_grow_table(space);
- if (kr != KERN_SUCCESS) {
- /* space is unlocked */
-
- if (kr == KERN_RESOURCE_SHORTAGE)
- return (MACH_RCV_HEADER_ERROR|
- MACH_MSG_IPC_KERNEL);
- else
- return (MACH_RCV_HEADER_ERROR|
- MACH_MSG_IPC_SPACE);
- }
- /* space is locked again; start over */
-
- continue;
+ is_write_unlock(space);
+ if (kr == KERN_RESOURCE_SHORTAGE)
+ return (MACH_RCV_HEADER_ERROR|
+ MACH_MSG_IPC_KERNEL);
+ else
+ return (MACH_RCV_HEADER_ERROR|
+ MACH_MSG_IPC_SPACE);
}
assert(IE_BITS_TYPE(entry->ie_bits)
@@ -2202,6 +2160,7 @@ ipc_kmsg_copyout_header(msg, space, notify)
*/
copyout_dest:
+ payload = dest->ip_protected_payload;
if (ip_active(dest)) {
ipc_object_copyout_dest(space, (ipc_object_t) dest,
@@ -2230,9 +2189,17 @@ ipc_kmsg_copyout_header(msg, space, notify)
if (IP_VALID(reply))
ipc_port_release(reply);
- msg->msgh_bits = (MACH_MSGH_BITS_OTHER(mbits) |
- MACH_MSGH_BITS(reply_type, dest_type));
- msg->msgh_local_port = dest_name;
+ if (! ipc_port_flag_protected_payload(dest)) {
+ msg->msgh_bits = (MACH_MSGH_BITS_OTHER(mbits) |
+ MACH_MSGH_BITS(reply_type, dest_type));
+ msg->msgh_local_port = dest_name;
+ } else {
+ msg->msgh_bits = (MACH_MSGH_BITS_OTHER(mbits) |
+ MACH_MSGH_BITS(reply_type,
+ MACH_MSG_TYPE_PROTECTED_PAYLOAD));
+ msg->msgh_protected_payload = payload;
+ }
+
msg->msgh_remote_port = reply_name;
}
@@ -2257,11 +2224,11 @@ ipc_kmsg_copyout_header(msg, space, notify)
*/
mach_msg_return_t
-ipc_kmsg_copyout_object(space, object, msgt_name, namep)
- ipc_space_t space;
- ipc_object_t object;
- mach_msg_type_name_t msgt_name;
- mach_port_t *namep;
+ipc_kmsg_copyout_object(
+ ipc_space_t space,
+ ipc_object_t object,
+ mach_msg_type_name_t msgt_name,
+ mach_port_t *namep)
{
if (!IO_VALID(object)) {
*namep = (mach_port_t) object;
@@ -2279,7 +2246,7 @@ ipc_kmsg_copyout_object(space, object, msgt_name, namep)
goto slow_copyout;
{
- register ipc_port_t port = (ipc_port_t) object;
+ ipc_port_t port = (ipc_port_t) object;
ipc_entry_t entry;
is_write_lock(space);
@@ -2290,12 +2257,13 @@ ipc_kmsg_copyout_object(space, object, msgt_name, namep)
ip_lock(port);
if (!ip_active(port) ||
- !ipc_hash_local_lookup(space, (ipc_object_t) port,
- namep, &entry)) {
+ (entry = ipc_reverse_lookup(space,
+ (ipc_object_t) port)) == NULL) {
ip_unlock(port);
is_write_unlock(space);
goto slow_copyout;
}
+ *namep = entry->ie_name;
/*
* Copyout the send right, incrementing urefs
@@ -2312,7 +2280,7 @@ ipc_kmsg_copyout_object(space, object, msgt_name, namep)
assert(IE_BITS_UREFS(entry->ie_bits) < MACH_PORT_UREFS_MAX);
{
- register ipc_entry_bits_t bits = entry->ie_bits + 1;
+ ipc_entry_bits_t bits = entry->ie_bits + 1;
if (IE_BITS_UREFS(bits) < MACH_PORT_UREFS_MAX)
entry->ie_bits = bits;
@@ -2367,10 +2335,11 @@ ipc_kmsg_copyout_object(space, object, msgt_name, namep)
*/
mach_msg_return_t
-ipc_kmsg_copyout_body(saddr, eaddr, space, map)
- vm_offset_t saddr, eaddr;
- ipc_space_t space;
- vm_map_t map;
+ipc_kmsg_copyout_body(
+ vm_offset_t saddr,
+ vm_offset_t eaddr,
+ ipc_space_t space,
+ vm_map_t map)
{
mach_msg_return_t mr = MACH_MSG_SUCCESS;
kern_return_t kr;
@@ -2519,11 +2488,11 @@ ipc_kmsg_copyout_body(saddr, eaddr, space, map)
*/
mach_msg_return_t
-ipc_kmsg_copyout(kmsg, space, map, notify)
- ipc_kmsg_t kmsg;
- ipc_space_t space;
- vm_map_t map;
- mach_port_t notify;
+ipc_kmsg_copyout(
+ ipc_kmsg_t kmsg,
+ ipc_space_t space,
+ vm_map_t map,
+ mach_port_t notify)
{
mach_msg_bits_t mbits = kmsg->ikm_header.msgh_bits;
mach_msg_return_t mr;
@@ -2613,9 +2582,9 @@ ipc_kmsg_copyout_pseudo(
*/
void
-ipc_kmsg_copyout_dest(kmsg, space)
- ipc_kmsg_t kmsg;
- ipc_space_t space;
+ipc_kmsg_copyout_dest(
+ ipc_kmsg_t kmsg,
+ ipc_space_t space)
{
mach_msg_bits_t mbits = kmsg->ikm_header.msgh_bits;
ipc_object_t dest = (ipc_object_t) kmsg->ikm_header.msgh_remote_port;
@@ -2661,9 +2630,9 @@ ipc_kmsg_copyout_dest(kmsg, space)
#if MACH_KDB
char *
-ipc_type_name(type_name, received)
- int type_name;
- boolean_t received;
+ipc_type_name(
+ int type_name,
+ boolean_t received)
{
switch (type_name) {
case MACH_MSG_TYPE_BOOLEAN:
@@ -2744,8 +2713,7 @@ ipc_print_type_name(
* ipc_kmsg_print [ debug ]
*/
void
-ipc_kmsg_print(kmsg)
- ipc_kmsg_t kmsg;
+ipc_kmsg_print(ipc_kmsg_t kmsg)
{
db_printf("kmsg=0x%x\n", kmsg);
db_printf("ikm_next=0x%x,prev=0x%x,size=%d,marequest=0x%x",
@@ -2761,8 +2729,7 @@ ipc_kmsg_print(kmsg)
* ipc_msg_print [ debug ]
*/
void
-ipc_msg_print(msgh)
- mach_msg_header_t *msgh;
+ipc_msg_print(mach_msg_header_t *msgh)
{
vm_offset_t saddr, eaddr;