]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/ipc/ipc_port.c
xnu-201.tar.gz
[apple/xnu.git] / osfmk / ipc / ipc_port.c
index 7cd8a39f7792a0388c7413965f8e825666c744e7..989d73b81a7547fddb4768f85ead57abfc332884 100644 (file)
@@ -888,29 +888,51 @@ ipc_port_lookup_notify(
 }
 
 /*
- *     Routine:        ipc_port_make_send
+ *     Routine:        ipc_port_make_send_locked
  *     Purpose:
  *             Make a naked send right from a receive right.
+ *
  *     Conditions:
- *             The port is not locked but it is active.
+ *             port locked and active.
  */
-
 ipc_port_t
-ipc_port_make_send(
+ipc_port_make_send_locked(
        ipc_port_t      port)
 {
-       assert(IP_VALID(port));
-
-       ip_lock(port);
        assert(ip_active(port));
        port->ip_mscount++;
        port->ip_srights++;
        ip_reference(port);
        ip_unlock(port);
-
        return port;
 }
 
+/*
+ *     Routine:        ipc_port_make_send
+ *     Purpose:
+ *             Make a naked send right from a receive right.
+ */
+
+ipc_port_t
+ipc_port_make_send(
+       ipc_port_t      port)
+{
+       
+       if (!IP_VALID(port))
+               return port;
+
+       ip_lock(port);
+       if (ip_active(port)) {
+               port->ip_mscount++;
+               port->ip_srights++;
+               ip_reference(port);
+               ip_unlock(port);
+               return port;
+       }
+       ip_unlock(port);
+       return IP_DEAD;
+}
+
 /*
  *     Routine:        ipc_port_copy_send
  *     Purpose:
@@ -1535,8 +1557,8 @@ print_ports(void)
        PRINT_ONE_PORT_TYPE(PSET);
        PRINT_ONE_PORT_TYPE(PSET_NAME);
        PRINT_ONE_PORT_TYPE(PAGING_REQUEST);
-       PRINT_ONE_PORT_TYPE(XMM_OBJECT);
-       PRINT_ONE_PORT_TYPE(DEVICE);
+       PRINT_ONE_PORT_TYPE(MEMORY_OBJECT);
+       PRINT_ONE_PORT_TYPE(MIG);
        PRINT_ONE_PORT_TYPE(XMM_PAGER);
        PRINT_ONE_PORT_TYPE(XMM_KERNEL);
        PRINT_ONE_PORT_TYPE(XMM_REPLY);