• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.5.8/xnu-1228.15.4/osfmk/device/

Lines Matching refs:port

35 #include <mach/port.h>
87 ipc_port_t port, ipc_kobject_type_t type, mach_port_mscount_t * mscount );
107 extern kern_return_t iokit_destroy_object_port( ipc_port_t port );
118 extern void iokit_retain_port( ipc_port_t port );
119 extern void iokit_release_port( ipc_port_t port );
121 extern kern_return_t iokit_switch_object_port( ipc_port_t port, io_object_t obj, ipc_kobject_type_t type );
138 * Lookup a device by its port.
143 ipc_port_t port)
147 if (!IP_VALID(port))
150 ip_lock(port);
151 if (ip_active(port) && (ip_kotype(port) == IKOT_IOKIT_OBJECT)) {
152 obj = (io_object_t) port->ip_kobject;
158 ip_unlock(port);
165 ipc_port_t port)
169 if (!IP_VALID(port))
172 ip_lock(port);
173 if (ip_active(port) && (ip_kotype(port) == IKOT_IOKIT_CONNECT)) {
174 obj = (io_object_t) port->ip_kobject;
180 ip_unlock(port);
191 ipc_port_t port;
194 kr = ipc_object_translate(space, (mach_port_name_t)connectRef, MACH_PORT_RIGHT_SEND, (ipc_object_t *)&port);
197 assert(IP_VALID(port));
199 if (ip_active(port) && (ip_kotype(port) == IKOT_IOKIT_CONNECT)) {
200 obj = (io_object_t) port->ip_kobject;
204 ip_unlock(port);
218 iokit_retain_port( ipc_port_t port )
220 ipc_port_reference( port );
224 iokit_release_port( ipc_port_t port )
226 ipc_port_release( port );
230 * Get the port for a device.
237 register ipc_port_t port;
243 port = iokit_port_for_object( obj, IKOT_IOKIT_OBJECT );
244 if( port) {
245 sendPort = ipc_port_make_send( port);
246 iokit_release_port( port );
259 register ipc_port_t port;
265 port = iokit_port_for_object( obj, IKOT_IOKIT_CONNECT );
266 if( port) {
267 sendPort = ipc_port_make_send( port);
268 iokit_release_port( port );
283 ipc_port_t port;
287 /* Allocate port, keeping a reference for it. */
288 port = ipc_port_alloc_kernel();
289 if( port == IP_NULL)
294 ipc_kobject_set( port, (ipc_kobject_t) obj, type);
296 /* Request no-senders notifications on the port. */
297 notify = ipc_port_make_sonce( port);
298 ip_lock( port);
299 ipc_port_nsrequest( port, 1, notify, &notify);
305 return( port );
310 iokit_destroy_object_port( ipc_port_t port )
312 ipc_kobject_set( port, IKO_NULL, IKOT_NONE);
316 ipc_port_dealloc_kernel( port);
323 iokit_switch_object_port( ipc_port_t port, io_object_t obj, ipc_kobject_type_t type )
325 ipc_kobject_set( port, (ipc_kobject_t) obj, type);
333 ipc_port_t port;
340 port = iokit_port_for_object( obj, type );
341 if( port) {
342 sendPort = ipc_port_make_send( port);
343 iokit_release_port( port );
370 * Handle the No-More_Senders notification generated from a device port destroy.
372 * port a NMS notification has been generated.
378 ipc_port_t port;
383 port = (ipc_port_t) notification->not_header.msgh_remote_port;
385 // convert a port to io_object_t.
386 if( IP_VALID(port)) {
387 ip_lock(port);
388 if( ip_active(port)) {
389 obj = (io_object_t) port->ip_kobject;
390 type = ip_kotype( port );
397 ip_unlock(port);
403 if( KERN_SUCCESS != iokit_client_died( obj, port, type, &mscount ))
405 /* Re-request no-senders notifications on the port. */
406 notify = ipc_port_make_sonce( port);
407 ip_lock( port);
408 ipc_port_nsrequest( port, mscount + 1, notify, &notify);