]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/device/iokit_rpc.c
xnu-7195.101.1.tar.gz
[apple/xnu.git] / osfmk / device / iokit_rpc.c
index c4c0bce85b3991982ba4aa207c6b0139b03b40b6..6c1c7fac36c69fb8495100ef99a33f25da9059d0 100644 (file)
@@ -25,7 +25,6 @@
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
  */
-#include <zone_debug.h>
 #include <mach/boolean.h>
 #include <mach/kern_return.h>
 #include <mach/mig_errors.h>
@@ -42,7 +41,6 @@
 
 #include <kern/clock.h>
 #include <kern/spl.h>
-#include <kern/counters.h>
 #include <kern/queue.h>
 #include <kern/zalloc.h>
 #include <kern/thread.h>
@@ -71,6 +69,9 @@
 #define EXTERN
 #define MIGEXTERN
 
+LCK_GRP_DECLARE(dev_lck_grp, "device");
+LCK_MTX_DECLARE(iokit_obj_to_port_binding_lock, &dev_lck_grp);
+
 /*
  * Lookup a device by its port.
  * Doesn't consume the naked send right; produces a device reference.
@@ -179,14 +180,18 @@ iokit_release_port( ipc_port_t port )
        ipc_port_release( port );
 }
 
+EXTERN void
+iokit_make_port_send( ipc_port_t port )
+{
+       ipc_port_make_send( port );
+}
+
 EXTERN void
 iokit_release_port_send( ipc_port_t port )
 {
        ipc_port_release_send( port );
 }
 
-extern lck_mtx_t iokit_obj_to_port_binding_lock;
-
 EXTERN void
 iokit_lock_port( __unused ipc_port_t port )
 {
@@ -310,9 +315,8 @@ iokit_make_send_right( task_t task, io_object_t obj, ipc_kobject_type_t type )
                // thread-argument-passing and its value should not be garbage
                current_thread()->ith_knote = ITH_KNOTE_NULL;
                kr = ipc_object_copyout( task->itk_space, ip_to_object(sendPort),
-                   MACH_MSG_TYPE_PORT_SEND, NULL, NULL, &name);
+                   MACH_MSG_TYPE_PORT_SEND, IPC_OBJECT_COPYOUT_FLAGS_NONE, NULL, NULL, &name);
                if (kr != KERN_SUCCESS) {
-                       ipc_port_release_send( sendPort );
                        name = MACH_PORT_NULL;
                }
        } else if (sendPort == IP_NULL) {