*
* @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
-#include <zone_debug.h>
#include <mach/boolean.h>
#include <mach/kern_return.h>
#include <mach/mig_errors.h>
#include <kern/clock.h>
#include <kern/spl.h>
-#include <kern/counters.h>
#include <kern/queue.h>
#include <kern/zalloc.h>
#include <kern/thread.h>
#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.
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 )
{
// 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) {