Lines Matching refs:msg
102 mach_msg_header_t *msg, in t_receive() argument
107 return mach_msg2(msg, opts, *msg, 0, size, name, 0, 0); in t_receive()
114 mach_msg_header_t *msg, in t_send() argument
118 mach_msg_size_t size = (mach_msg_size_t)((char *)upto - (char *)msg); in t_send()
122 msg->msgh_bits = MACH_MSGH_BITS_SET(MACH_MSG_TYPE_COPY_SEND, 0, 0, 0); in t_send()
123 msg->msgh_size = size; in t_send()
124 msg->msgh_remote_port = dest; in t_send()
125 msg->msgh_local_port = MACH_PORT_NULL; in t_send()
126 msg->msgh_voucher_port = MACH_PORT_NULL; in t_send()
127 msg->msgh_id = 42; in t_send()
128 return mach_msg2(msg, opts, *msg, size, 0, 0, 0, 0); in t_send()
139 mach_msg_header_t *msg = &base->header; in t_send() local
140 mach_msg_size_t size = (mach_msg_size_t)((char *)upto - (char *)msg); in t_send()
144 msg->msgh_bits = MACH_MSGH_BITS_SET(MACH_MSG_TYPE_COPY_SEND, 0, 0, in t_send()
146 msg->msgh_size = size; in t_send()
147 msg->msgh_remote_port = dest; in t_send()
148 msg->msgh_local_port = MACH_PORT_NULL; in t_send()
149 msg->msgh_voucher_port = MACH_PORT_NULL; in t_send()
150 msg->msgh_id = 42; in t_send()
151 return mach_msg2(msg, opts, *msg, size, 0, 0, 0, 0); in t_send()
299 struct msg_complex_port *msg, in t_fill_complex_port_msg() argument
303 *msg = (struct msg_complex_port){ in t_fill_complex_port_msg()
315 struct msg_complex_guarded_port *msg, in t_fill_complex_port_guarded_msg() argument
320 *msg = (struct msg_complex_guarded_port){ in t_fill_complex_port_guarded_msg()
331 msg->dsc.context = 0; in t_fill_complex_port_guarded_msg()
337 struct msg_complex_memory *msg, in t_fill_complex_memory_msg() argument
342 *msg = (struct msg_complex_memory){ in t_fill_complex_memory_msg()
355 struct msg_complex_port_array *msg, in t_fill_complex_port_array_msg() argument
360 *msg = (struct msg_complex_port_array){ in t_fill_complex_port_array_msg()
365 .address = &msg->array, in t_fill_complex_port_array_msg()
390 struct msg_complex_port msg; in t_mach_msg_descriptor_port() local
396 t_fill_complex_port_msg(&msg, disp, name); in t_mach_msg_descriptor_port()
398 kr = t_send(rcv_name, &msg.base, &msg.trailer, MACH64_SEND_TIMEOUT); in t_mach_msg_descriptor_port()
405 kr = t_receive(rcv_name, &msg.base.header, sizeof(msg), in t_mach_msg_descriptor_port()
425 T_ASSERT_EQ(msg.base.header.msgh_bits & MACH_MSGH_BITS_COMPLEX, in t_mach_msg_descriptor_port()
427 T_ASSERT_EQ(msg.base.body.msgh_descriptor_count, 1u, "verify dsc count"); in t_mach_msg_descriptor_port()
428 T_ASSERT_EQ((mach_msg_descriptor_type_t)msg.dsc.type, MACH_MSG_PORT_DESCRIPTOR, "verify type"); in t_mach_msg_descriptor_port()
429 T_ASSERT_EQ((mach_msg_type_name_t)msg.dsc.disposition, disp, "verify disposition"); in t_mach_msg_descriptor_port()
432 T_ASSERT_EQ(msg.dsc.name, name, "verify name"); in t_mach_msg_descriptor_port()
436 t_deallocate_sonce(msg.dsc.name); in t_mach_msg_descriptor_port()
471 struct msg_complex_guarded_port msg; in t_mach_msg_descriptor_guarded_port() local
480 t_fill_complex_port_guarded_msg(&msg, MACH_MSG_TYPE_MOVE_RECEIVE, in t_mach_msg_descriptor_guarded_port()
483 kr = t_send(rcv_name, &msg.base, &msg.trailer, MACH64_SEND_TIMEOUT); in t_mach_msg_descriptor_guarded_port()
489 kr = t_receive(rcv_name, &msg.base.header, sizeof(msg), in t_mach_msg_descriptor_guarded_port()
494 T_ASSERT_EQ(msg.base.header.msgh_bits & MACH_MSGH_BITS_COMPLEX, in t_mach_msg_descriptor_guarded_port()
496 T_ASSERT_EQ(msg.base.body.msgh_descriptor_count, 1u, "verify dsc count"); in t_mach_msg_descriptor_guarded_port()
497 T_ASSERT_EQ((mach_msg_descriptor_type_t)msg.dsc.type, in t_mach_msg_descriptor_guarded_port()
499 T_ASSERT_EQ((mach_msg_type_name_t)msg.dsc.disposition, in t_mach_msg_descriptor_guarded_port()
501 T_ASSERT_EQ(msg.dsc.name, port, "verify name"); in t_mach_msg_descriptor_guarded_port()
502 ctx = (mach_port_context_t)&msg.base; in t_mach_msg_descriptor_guarded_port()
503 T_ASSERT_EQ(msg.dsc.context, ctx, "verify context"); in t_mach_msg_descriptor_guarded_port()
549 struct msg_complex_port_array msg; in t_mach_msg_descriptor_port_array() local
552 t_fill_complex_port_array_msg(&msg, disp, name1, name2); in t_mach_msg_descriptor_port_array()
554 kr = t_send(rcv_name, &msg.base, &msg.trailer, MACH64_SEND_TIMEOUT); in t_mach_msg_descriptor_port_array()
561 kr = t_receive(rcv_name, &msg.base.header, sizeof(msg), in t_mach_msg_descriptor_port_array()
567 array = msg.dsc.address; in t_mach_msg_descriptor_port_array()
569 T_ASSERT_EQ(msg.base.header.msgh_bits & MACH_MSGH_BITS_COMPLEX, in t_mach_msg_descriptor_port_array()
571 T_ASSERT_EQ(msg.base.body.msgh_descriptor_count, 1u, "verify dsc count"); in t_mach_msg_descriptor_port_array()
572 …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()
573 T_ASSERT_EQ((mach_msg_type_name_t)msg.dsc.disposition, disp, "verify disposition"); in t_mach_msg_descriptor_port_array()
574 T_ASSERT_EQ(msg.dsc.count, 2u, "verify count"); in t_mach_msg_descriptor_port_array()
575 T_ASSERT_EQ((bool)msg.dsc.deallocate, true, "verify deallocate"); in t_mach_msg_descriptor_port_array()
580 t_vm_deallocate(array, sizeof(array[0]) * msg.dsc.count); in t_mach_msg_descriptor_port_array()
599 struct msg_complex_memory msg; in t_mach_msg_descriptor_memory() local
616 t_fill_complex_memory_msg(&msg, addr, size, n > 0); in t_mach_msg_descriptor_memory()
618 kr = t_send(rcv_name, &msg.base, &msg.trailer, MACH64_SEND_TIMEOUT); in t_mach_msg_descriptor_memory()
624 kr = t_receive(rcv_name, &msg.base.header, sizeof(msg), in t_mach_msg_descriptor_memory()
629 T_ASSERT_EQ(msg.base.header.msgh_bits & MACH_MSGH_BITS_COMPLEX, in t_mach_msg_descriptor_memory()
631 T_ASSERT_EQ(msg.base.body.msgh_descriptor_count, 1u, "verify dsc count"); in t_mach_msg_descriptor_memory()
632 T_ASSERT_EQ((mach_msg_descriptor_type_t)msg.dsc.type, in t_mach_msg_descriptor_memory()
634 T_ASSERT_EQ(msg.dsc.size, size, "verify dsc count"); in t_mach_msg_descriptor_memory()
635 T_ASSERT_EQ(t_check_0xff(msg.dsc.address, size), ~0ul, in t_mach_msg_descriptor_memory()
639 t_vm_deallocate(msg.dsc.address, size); in t_mach_msg_descriptor_memory()
641 addr = (vm_address_t)msg.dsc.address; in t_mach_msg_descriptor_memory()