Lines Matching refs:port
75 #include <mach/port.h>
79 #include <ipc/port.h>
194 ipc_port_t port;
203 port = (ipc_port_t) object;
205 ip_lock(port);
206 if (!ip_active(port)) {
207 ip_unlock(port);
212 if (port->ip_receiver == space) {
213 name = port->ip_receiver_name;
220 assert(port == (ipc_port_t) entry->ie_object);
227 if (ipc_hash_lookup(space, (ipc_object_t) port, namep, entryp)) {
230 assert(port == (ipc_port_t) entry->ie_object);
235 ip_unlock(port);
259 * KERN_INVALID_RIGHT Name doesn't denote port/dead rights.
288 ipc_port_t port;
291 port = (ipc_port_t) entry->ie_object;
292 assert(port != IP_NULL);
294 if (!ipc_right_check(space, port, name, entry)) {
295 /* port is locked and active */
299 space, port, name, entry);
301 ip_unlock(port);
317 port, name, entry);
319 kr = ipc_port_dnrequest(port, name, notify,
325 kr = ipc_port_dngrow(port,
327 /* port is unlocked */
335 ip_unlock(port);
344 * because it found an inactive port and removed our
347 * the port name anymore).
393 * The space must be write-locked; the port must be locked.
394 * The port must be active; the space doesn't have to be.
400 ipc_port_t port,
406 assert(ip_active(port));
407 assert(port == (ipc_port_t) entry->ie_object);
409 dnrequest = ipc_port_dncancel(port, name, entry->ie_request);
441 * Check if the port has died. If it has,
444 * The space is write-locked; the port is not locked.
445 * If returns FALSE, the port is also locked and active.
447 * a reference to port.
453 ipc_port_t port,
460 assert(port == (ipc_port_t) entry->ie_object);
462 ip_lock(port);
463 if (ip_active(port))
465 ip_unlock(port);
481 ipc_port_release(port);
486 ipc_hash_delete(space, (ipc_object_t)port, name, entry);
492 * name, and since the port went dead, that notification
493 * must already be on its way up from the port layer. We
494 * don't need the index of the notification port anymore.
542 * problem, because we check that the port is active. If
572 ipc_port_t port = (ipc_port_t) entry->ie_object;
577 assert(port != IP_NULL);
578 ip_lock(port);
580 if (!ip_active(port)) {
581 ip_release(port);
582 ip_check_unlock(port);
586 dnrequest = ipc_right_dncancel_macro(space, port,
590 assert(port->ip_srights > 0);
591 if (--port->ip_srights == 0
593 nsrequest = port->ip_nsrequest;
595 port->ip_nsrequest = IP_NULL;
596 mscount = port->ip_mscount;
602 assert(port->ip_receiver_name == name);
603 assert(port->ip_receiver == space);
605 ipc_port_clear_receiver(port);
606 ipc_port_destroy(port); /* consumes our ref, unlocks */
608 assert(port->ip_sorights > 0);
609 ip_unlock(port);
611 ipc_notify_send_once(port); /* consumes our ref */
613 assert(port->ip_receiver != space);
615 ip_release(port);
616 ip_unlock(port); /* port is active */
686 ipc_port_t port = (ipc_port_t) entry->ie_object;
691 assert(port != IP_NULL);
694 ipc_hash_delete(space, (ipc_object_t) port,
697 ip_lock(port);
699 if (!ip_active(port)) {
701 ip_release(port);
702 ip_check_unlock(port);
711 dnrequest = ipc_right_dncancel_macro(space, port, name, entry);
717 assert(port->ip_srights > 0);
718 if (--port->ip_srights == 0) {
719 nsrequest = port->ip_nsrequest;
721 port->ip_nsrequest = IP_NULL;
722 mscount = port->ip_mscount;
728 assert(ip_active(port));
729 assert(port->ip_receiver == space);
731 ipc_port_clear_receiver(port);
732 ipc_port_destroy(port); /* consumes our ref, unlocks */
734 assert(port->ip_sorights > 0);
735 ip_unlock(port);
737 ipc_notify_send_once(port); /* consumes our ref */
739 assert(port->ip_receiver != space);
741 ip_release(port);
742 ip_unlock(port);
809 ipc_port_t port, dnrequest;
813 port = (ipc_port_t) entry->ie_object;
814 assert(port != IP_NULL);
816 if (ipc_right_check(space, port, name, entry)) {
822 /* port is locked and active */
824 assert(port->ip_sorights > 0);
826 dnrequest = ipc_right_dncancel_macro(space, port, name, entry);
827 ip_unlock(port);
834 ipc_notify_send_once(port);
842 ipc_port_t port;
850 port = (ipc_port_t) entry->ie_object;
851 assert(port != IP_NULL);
853 if (ipc_right_check(space, port, name, entry)) {
858 /* port is locked and active */
860 assert(port->ip_srights > 0);
863 if (--port->ip_srights == 0) {
864 nsrequest = port->ip_nsrequest;
866 port->ip_nsrequest = IP_NULL;
867 mscount = port->ip_mscount;
871 dnrequest = ipc_right_dncancel_macro(space, port,
873 ipc_hash_delete(space, (ipc_object_t) port,
876 ip_release(port);
883 /* even if dropped a ref, port is active */
884 ip_unlock(port);
896 ipc_port_t port;
902 port = (ipc_port_t) entry->ie_object;
903 assert(port != IP_NULL);
905 ip_lock(port);
906 assert(ip_active(port));
907 assert(port->ip_receiver_name == name);
908 assert(port->ip_receiver == space);
909 assert(port->ip_srights > 0);
912 if (--port->ip_srights == 0) {
913 nsrequest = port->ip_nsrequest;
915 port->ip_nsrequest = IP_NULL;
916 mscount = port->ip_mscount;
925 ip_unlock(port);
972 * where we have postponed the dropping of a port reference. Since
973 * the dropping of the reference could cause the port to disappear
1017 ipc_port_t port;
1029 port = (ipc_port_t) entry->ie_object;
1030 assert(port != IP_NULL);
1033 * The port lock is needed for ipc_right_dncancel;
1038 ip_lock(port);
1039 assert(ip_active(port));
1040 assert(port->ip_receiver_name == name);
1041 assert(port->ip_receiver == space);
1048 assert(port->ip_srights > 0);
1055 * port is destroyed "first".
1069 dnrequest = ipc_right_dncancel_macro(space, port,
1076 ipc_port_clear_receiver(port);
1077 ipc_port_destroy(port); /* consumes ref, unlocks */
1085 ipc_port_t port, dnrequest;
1093 port = (ipc_port_t) entry->ie_object;
1094 assert(port != IP_NULL);
1096 if (ipc_right_check(space, port, name, entry)) {
1100 /* port is locked and active */
1102 assert(port->ip_sorights > 0);
1105 ip_unlock(port);
1110 ip_unlock(port);
1114 dnrequest = ipc_right_dncancel_macro(space, port, name, entry);
1115 ip_unlock(port);
1122 ipc_notify_send_once(port);
1133 ipc_port_t port;
1135 port = (ipc_port_t) entry->ie_object;
1136 assert(port != IP_NULL);
1138 if (!ipc_right_check(space, port, name, entry)) {
1139 /* port is locked and active */
1140 ip_unlock(port);
1171 ipc_port_t port;
1181 port = (ipc_port_t) entry->ie_object;
1182 assert(port != IP_NULL);
1184 if (ipc_right_check(space, port, name, entry)) {
1188 /* port is locked and active */
1190 assert(port->ip_srights > 0);
1194 ip_unlock(port);
1198 ip_unlock(port);
1203 if (--port->ip_srights == 0) {
1204 nsrequest = port->ip_nsrequest;
1206 port->ip_nsrequest = IP_NULL;
1207 mscount = port->ip_mscount;
1212 assert(port->ip_receiver_name == name);
1213 assert(port->ip_receiver == space);
1223 dnrequest = ipc_right_dncancel_macro(space, port,
1225 ipc_hash_delete(space, (ipc_object_t) port,
1228 ip_release(port);
1236 /* even if dropped a ref, port is active */
1237 ip_unlock(port);
1297 ipc_port_t port = (ipc_port_t) entry->ie_object;
1299 if (ipc_right_check(space, port, name, entry)) {
1303 ip_unlock(port);
1333 ipc_port_t port;
1348 port = (ipc_port_t) entry->ie_object;
1349 ip_lock(port);
1351 rc = mac_port_check_make_send(&self->maclabel, &port->ip_label); tasklabel_unlock(self);
1352 ip_unlock(port);
1363 port = (ipc_port_t) entry->ie_object;
1364 ip_lock(port);
1366 rc = mac_port_check_make_send_once(&self->maclabel, &port->ip_label);
1368 ip_unlock(port);
1379 port = (ipc_port_t) entry->ie_object;
1380 ip_lock(port);
1382 rc = mac_port_check_move_receive(&self->maclabel, &port->ip_label);
1384 ip_unlock(port);
1401 port = (ipc_port_t) entry->ie_object;
1402 assert(port != IP_NULL);
1404 ip_lock(port);
1405 active = ip_active(port);
1411 &port->ip_label);
1415 &port->ip_label);
1419 &port->ip_label);
1426 ip_unlock(port);
1430 ip_unlock(port);
1461 * be used in a port-deleted notification.
1499 ipc_port_t port;
1504 port = (ipc_port_t) entry->ie_object;
1505 assert(port != IP_NULL);
1507 ip_lock(port);
1508 assert(ip_active(port));
1509 assert(port->ip_receiver_name == name);
1510 assert(port->ip_receiver == space);
1514 rc = mac_port_check_make_send(&self->maclabel, &port->ip_label);
1517 ip_unlock(port);
1522 port->ip_mscount++;
1523 port->ip_srights++;
1524 ip_reference(port);
1525 ip_unlock(port);
1527 *objectp = (ipc_object_t) port;
1533 ipc_port_t port;
1538 port = (ipc_port_t) entry->ie_object;
1539 assert(port != IP_NULL);
1541 ip_lock(port);
1542 assert(ip_active(port));
1543 assert(port->ip_receiver_name == name);
1544 assert(port->ip_receiver == space);
1548 rc = mac_port_check_make_send_once(&self->maclabel, &port->ip_label);
1551 ip_unlock(port);
1556 port->ip_sorights++;
1557 ip_reference(port);
1558 ip_unlock(port);
1560 *objectp = (ipc_object_t) port;
1566 ipc_port_t port;
1572 port = (ipc_port_t) entry->ie_object;
1573 assert(port != IP_NULL);
1575 ip_lock(port);
1576 assert(ip_active(port));
1577 assert(port->ip_receiver_name == name);
1578 assert(port->ip_receiver == space);
1583 &port->ip_label);
1586 ip_unlock(port);
1595 assert(port->ip_srights > 0);
1597 ipc_hash_insert(space, (ipc_object_t) port,
1599 ip_reference(port);
1604 dnrequest = ipc_right_dncancel_macro(space, port,
1610 ipc_port_clear_receiver(port);
1612 port->ip_receiver_name = MACH_PORT_NULL;
1613 port->ip_destination = IP_NULL;
1614 ip_unlock(port);
1616 *objectp = (ipc_object_t) port;
1622 ipc_port_t port;
1634 port = (ipc_port_t) entry->ie_object;
1635 assert(port != IP_NULL);
1637 if (ipc_right_check(space, port, name, entry)) {
1641 /* port is locked and active */
1645 rc = mac_port_check_copy_send(&self->maclabel, &port->ip_label);
1648 ip_unlock(port);
1655 assert(port->ip_sorights > 0);
1657 ip_unlock(port);
1661 assert(port->ip_srights > 0);
1663 port->ip_srights++;
1664 ip_reference(port);
1665 ip_unlock(port);
1667 *objectp = (ipc_object_t) port;
1673 ipc_port_t port;
1686 port = (ipc_port_t) entry->ie_object;
1687 assert(port != IP_NULL);
1689 if (ipc_right_check(space, port, name, entry)) {
1693 /* port is locked and active */
1697 rc = mac_port_check_copy_send (&self->maclabel, &port->ip_label);
1701 ip_unlock (port);
1708 assert(port->ip_sorights > 0);
1710 ip_unlock(port);
1714 assert(port->ip_srights > 0);
1718 assert(port->ip_receiver_name == name);
1719 assert(port->ip_receiver == space);
1723 ip_reference(port);
1728 dnrequest = ipc_right_dncancel_macro(space, port,
1730 ipc_hash_delete(space, (ipc_object_t) port,
1737 port->ip_srights++;
1738 ip_reference(port);
1742 ip_unlock(port);
1744 *objectp = (ipc_object_t) port;
1750 ipc_port_t port;
1763 port = (ipc_port_t) entry->ie_object;
1764 assert(port != IP_NULL);
1766 if (ipc_right_check(space, port, name, entry)) {
1770 /* port is locked and active */
1774 rc = mac_port_check_copy_send (&self->maclabel, &port->ip_label);
1778 ip_unlock (port);
1785 assert(port->ip_srights > 0);
1787 ip_unlock(port);
1793 assert(port->ip_sorights > 0);
1795 dnrequest = ipc_right_dncancel_macro(space, port, name, entry);
1796 ip_unlock(port);
1802 *objectp = (ipc_object_t) port;
1852 * (Object is either IO_DEAD or a dead port.)
1952 ipc_port_t port;
1970 port = (ipc_port_t) entry->ie_object;
1971 assert(port != IP_NULL);
1973 if (ipc_right_check(space, port, name, entry)) {
1976 /* port is locked and active */
1980 rc = mac_port_check_copy_send(&self->maclabel, &port->ip_label);
1983 ip_unlock(port);
1988 assert(port->ip_srights > 0);
1992 assert(port->ip_receiver_name == name);
1993 assert(port->ip_receiver == space);
1997 port->ip_srights++;
1998 ip_reference(port);
1999 ip_reference(port);
2003 dnrequest = ipc_right_dncancel_macro(space, port,
2006 port->ip_srights++;
2007 ip_reference(port);
2008 ipc_hash_delete(space, (ipc_object_t) port,
2014 port->ip_srights += 2;
2015 ip_reference(port);
2016 ip_reference(port);
2019 ip_unlock(port);
2021 *objectp = (ipc_object_t) port;
2063 ipc_port_t port;
2075 port = (ipc_port_t) object;
2081 assert(port->ip_sorights > 0);
2087 &port->ip_label);
2091 ip_unlock(port);
2097 ip_unlock(port);
2103 assert(port->ip_srights > 0);
2109 &port->ip_label);
2113 ip_unlock(port);
2122 assert(port->ip_srights > 1);
2130 port->ip_srights--;
2131 ip_release(port);
2132 ip_unlock(port);
2136 ip_unlock(port);
2140 port->ip_srights--;
2141 ip_release(port);
2142 ip_unlock(port);
2148 ip_release(port);
2149 ip_unlock(port);
2155 ip_unlock(port);
2157 /* entry is locked holding ref, so can use port */
2159 ipc_hash_insert(space, (ipc_object_t) port,
2169 assert(port->ip_mscount == 0);
2170 assert(port->ip_receiver_name == MACH_PORT_NULL);
2171 dest = port->ip_destination;
2177 &port->ip_label);
2181 ip_unlock(port);
2187 port->ip_receiver_name = name;
2188 port->ip_receiver = space;
2195 assert(port->ip_srights > 0);
2197 ip_release(port);
2198 ip_unlock(port);
2200 /* entry is locked holding ref, so can use port */
2202 ipc_hash_delete(space, (ipc_object_t) port,
2209 ip_unlock(port);
2255 * if the port is dead. (This would foil ipc_port_destroy.)
2261 ipc_port_t port;
2264 port = (ipc_port_t) object;
2265 assert(port != IP_NULL);
2267 if (ipc_right_check(space, port, oname, oentry)) {
2274 /* port is locked and active */
2276 ipc_port_dnrename(port, request, oname, nname);
2277 ip_unlock(port);
2291 ipc_port_t port;
2293 port = (ipc_port_t) object;
2294 assert(port != IP_NULL);
2299 ipc_hash_delete(space, (ipc_object_t) port, oname, oentry);
2300 ipc_hash_insert(space, (ipc_object_t) port, nname, nentry);
2306 ipc_port_t port;
2308 port = (ipc_port_t) object;
2309 assert(port != IP_NULL);
2311 ip_lock(port);
2312 assert(ip_active(port));
2313 assert(port->ip_receiver_name == oname);
2314 assert(port->ip_receiver == space);
2316 port->ip_receiver_name = nname;
2317 ip_unlock(port);