Lines Matching refs:msg
103 mach_msg_header_t *msg, in t_receive() argument
108 return mach_msg2(msg, opts, *msg, 0, size, name, 0, 0); in t_receive()
115 mach_msg_header_t *msg, in t_send() argument
119 mach_msg_size_t size = (mach_msg_size_t)((char *)upto - (char *)msg); in t_send()
123 msg->msgh_bits = MACH_MSGH_BITS_SET(MACH_MSG_TYPE_COPY_SEND, 0, 0, 0); in t_send()
124 msg->msgh_size = size; in t_send()
125 msg->msgh_remote_port = dest; in t_send()
126 msg->msgh_local_port = MACH_PORT_NULL; in t_send()
127 msg->msgh_voucher_port = MACH_PORT_NULL; in t_send()
128 msg->msgh_id = 42; in t_send()
129 return mach_msg2(msg, opts, *msg, size, 0, 0, 0, 0); in t_send()
140 mach_msg_header_t *msg = &base->header; in t_send() local
141 mach_msg_size_t size = (mach_msg_size_t)((char *)upto - (char *)msg); in t_send()
145 msg->msgh_bits = MACH_MSGH_BITS_SET(MACH_MSG_TYPE_COPY_SEND, 0, 0, in t_send()
147 msg->msgh_size = size; in t_send()
148 msg->msgh_remote_port = dest; in t_send()
149 msg->msgh_local_port = MACH_PORT_NULL; in t_send()
150 msg->msgh_voucher_port = MACH_PORT_NULL; in t_send()
151 msg->msgh_id = 42; in t_send()
152 return mach_msg2(msg, opts, *msg, size, 0, 0, 0, 0); in t_send()
300 struct msg_complex_port *msg, in t_fill_complex_port_msg() argument
304 *msg = (struct msg_complex_port){ in t_fill_complex_port_msg()
316 struct msg_complex_guarded_port *msg, in t_fill_complex_port_guarded_msg() argument
321 *msg = (struct msg_complex_guarded_port){ in t_fill_complex_port_guarded_msg()
332 msg->dsc.context = 0; in t_fill_complex_port_guarded_msg()
338 struct msg_complex_memory *msg, in t_fill_complex_memory_msg() argument
343 *msg = (struct msg_complex_memory){ in t_fill_complex_memory_msg()
356 struct msg_complex_port_array *msg, in t_fill_complex_port_array_msg() argument
361 *msg = (struct msg_complex_port_array){ in t_fill_complex_port_array_msg()
366 .address = &msg->array, in t_fill_complex_port_array_msg()
391 struct msg_complex_port msg; in t_mach_msg_descriptor_port() local
397 t_fill_complex_port_msg(&msg, disp, name); in t_mach_msg_descriptor_port()
399 kr = t_send(rcv_name, &msg.base, &msg.trailer, MACH64_SEND_TIMEOUT); in t_mach_msg_descriptor_port()
406 kr = t_receive(rcv_name, &msg.base.header, sizeof(msg), in t_mach_msg_descriptor_port()
426 T_ASSERT_EQ(msg.base.header.msgh_bits & MACH_MSGH_BITS_COMPLEX, in t_mach_msg_descriptor_port()
428 T_ASSERT_EQ(msg.base.body.msgh_descriptor_count, 1u, "verify dsc count"); in t_mach_msg_descriptor_port()
429 T_ASSERT_EQ((mach_msg_descriptor_type_t)msg.dsc.type, MACH_MSG_PORT_DESCRIPTOR, "verify type"); in t_mach_msg_descriptor_port()
430 T_ASSERT_EQ((mach_msg_type_name_t)msg.dsc.disposition, disp, "verify disposition"); in t_mach_msg_descriptor_port()
433 T_ASSERT_EQ(msg.dsc.name, name, "verify name"); in t_mach_msg_descriptor_port()
437 t_deallocate_sonce(msg.dsc.name); in t_mach_msg_descriptor_port()
472 struct msg_complex_guarded_port msg; in t_mach_msg_descriptor_guarded_port() local
481 t_fill_complex_port_guarded_msg(&msg, MACH_MSG_TYPE_MOVE_RECEIVE, in t_mach_msg_descriptor_guarded_port()
484 kr = t_send(rcv_name, &msg.base, &msg.trailer, MACH64_SEND_TIMEOUT); in t_mach_msg_descriptor_guarded_port()
490 kr = t_receive(rcv_name, &msg.base.header, sizeof(msg), in t_mach_msg_descriptor_guarded_port()
495 T_ASSERT_EQ(msg.base.header.msgh_bits & MACH_MSGH_BITS_COMPLEX, in t_mach_msg_descriptor_guarded_port()
497 T_ASSERT_EQ(msg.base.body.msgh_descriptor_count, 1u, "verify dsc count"); in t_mach_msg_descriptor_guarded_port()
498 T_ASSERT_EQ((mach_msg_descriptor_type_t)msg.dsc.type, in t_mach_msg_descriptor_guarded_port()
500 T_ASSERT_EQ((mach_msg_type_name_t)msg.dsc.disposition, in t_mach_msg_descriptor_guarded_port()
502 T_ASSERT_EQ(msg.dsc.name, port, "verify name"); in t_mach_msg_descriptor_guarded_port()
503 ctx = (mach_port_context_t)&msg.base; in t_mach_msg_descriptor_guarded_port()
504 T_ASSERT_EQ(msg.dsc.context, ctx, "verify context"); in t_mach_msg_descriptor_guarded_port()
537 struct msg_complex_port_array msg; in t_mach_msg_descriptor_port_array() local
545 t_fill_complex_port_array_msg(&msg, disp, name1, name2); in t_mach_msg_descriptor_port_array()
547 kr = t_send(rcv_name, &msg.base, &msg.trailer, MACH64_SEND_TIMEOUT); in t_mach_msg_descriptor_port_array()
554 kr = t_receive(rcv_name, &msg.base.header, sizeof(msg), in t_mach_msg_descriptor_port_array()
574 array = msg.dsc.address; in t_mach_msg_descriptor_port_array()
576 T_ASSERT_EQ(msg.base.header.msgh_bits & MACH_MSGH_BITS_COMPLEX, in t_mach_msg_descriptor_port_array()
578 T_ASSERT_EQ(msg.base.body.msgh_descriptor_count, 1u, "verify dsc count"); in t_mach_msg_descriptor_port_array()
579 …T_ASSERT_EQ((mach_msg_descriptor_type_t)msg.dsc.type, MACH_MSG_OOL_PORTS_DESCRIPTOR, "verify type"… in t_mach_msg_descriptor_port_array()
580 T_ASSERT_EQ((mach_msg_type_name_t)msg.dsc.disposition, disp, "verify disposition"); in t_mach_msg_descriptor_port_array()
581 T_ASSERT_EQ(msg.dsc.count, 2u, "verify count"); in t_mach_msg_descriptor_port_array()
582 T_ASSERT_EQ((bool)msg.dsc.deallocate, true, "verify deallocate"); in t_mach_msg_descriptor_port_array()
595 t_vm_deallocate(array, sizeof(array[0]) * msg.dsc.count); in t_mach_msg_descriptor_port_array()
615 struct msg_complex_memory msg; in t_mach_msg_descriptor_memory() local
632 t_fill_complex_memory_msg(&msg, addr, size, n > 0); in t_mach_msg_descriptor_memory()
634 kr = t_send(rcv_name, &msg.base, &msg.trailer, MACH64_SEND_TIMEOUT); in t_mach_msg_descriptor_memory()
640 kr = t_receive(rcv_name, &msg.base.header, sizeof(msg), in t_mach_msg_descriptor_memory()
645 T_ASSERT_EQ(msg.base.header.msgh_bits & MACH_MSGH_BITS_COMPLEX, in t_mach_msg_descriptor_memory()
647 T_ASSERT_EQ(msg.base.body.msgh_descriptor_count, 1u, "verify dsc count"); in t_mach_msg_descriptor_memory()
648 T_ASSERT_EQ((mach_msg_descriptor_type_t)msg.dsc.type, in t_mach_msg_descriptor_memory()
650 T_ASSERT_EQ(msg.dsc.size, size, "verify dsc count"); in t_mach_msg_descriptor_memory()
651 T_ASSERT_EQ(t_check_0xff(msg.dsc.address, size), ~0ul, in t_mach_msg_descriptor_memory()
655 t_vm_deallocate(msg.dsc.address, size); in t_mach_msg_descriptor_memory()
657 addr = (vm_address_t)msg.dsc.address; in t_mach_msg_descriptor_memory()