X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/2d21ac55c334faf3a56e5634905ed6987fc787d4..4ba76501152d51ccb5647018f3192c6096367d48:/osfmk/ipc/ipc_notify.c diff --git a/osfmk/ipc/ipc_notify.c b/osfmk/ipc/ipc_notify.c index bbffba8bc..9744b2b62 100644 --- a/osfmk/ipc/ipc_notify.c +++ b/osfmk/ipc/ipc_notify.c @@ -2,7 +2,7 @@ * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ - * + * * This file contains Original Code and/or Modifications of Original Code * as defined in and that are subject to the Apple Public Source License * Version 2.0 (the 'License'). You may not use this file except in @@ -11,10 +11,10 @@ * unlawful or unlicensed copies of an Apple operating system, or to * circumvent, violate, or enable the circumvention or violation of, any * terms of an Apple operating system software license agreement. - * + * * Please obtain a copy of the License at * http://www.opensource.apple.com/apsl/ and read it before using this file. - * + * * The Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, @@ -22,34 +22,34 @@ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. - * + * * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ */ /* * @OSF_COPYRIGHT@ */ -/* +/* * Mach Operating System * Copyright (c) 1991,1990,1989 Carnegie Mellon University * All Rights Reserved. - * + * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. - * + * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * + * * Carnegie Mellon requests users of this software to return to - * + * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 - * + * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. */ @@ -81,16 +81,29 @@ void ipc_notify_port_deleted( - ipc_port_t port, - mach_port_name_t name) + ipc_port_t port, + mach_port_name_t name) { - kern_return_t kr; + (void)mach_notify_port_deleted(port, name); + /* send-once right consumed */ +} - kr = mach_notify_port_deleted(port, name); - if (kr != KERN_SUCCESS) { - printf("dropped port-deleted (%p, 0x%x)\n", port, name); - ipc_port_release_sonce(port); - } +/* + * Routine: ipc_notify_send_possible + * Purpose: + * Send a send-possible notification. + * Conditions: + * Nothing locked. + * Consumes a ref/soright for port. + */ + +void +ipc_notify_send_possible( + ipc_port_t port, + mach_port_name_t name) +{ + (void)mach_notify_send_possible(port, name); + /* send-once right consumed */ } /* @@ -107,18 +120,11 @@ ipc_notify_port_deleted( void ipc_notify_port_destroyed( - ipc_port_t port, - ipc_port_t right) + ipc_port_t port, + ipc_port_t right) { - kern_return_t kr; - - kr = mach_notify_port_destroyed(port, right); - if (kr != KERN_SUCCESS) { - printf("dropped port-destroyed (%p, %p)\n", - port, right); - ipc_port_release_sonce(port); - ipc_port_release_receive(right); - } + mach_notify_port_destroyed(port, right); + /* send-once and receive rights consumed */ } /* @@ -132,16 +138,11 @@ ipc_notify_port_destroyed( void ipc_notify_no_senders( - ipc_port_t port, - mach_port_mscount_t mscount) + ipc_port_t port, + mach_port_mscount_t mscount) { - kern_return_t kr; - - kr = mach_notify_no_senders(port, mscount); - if (kr != KERN_SUCCESS) { - printf("dropped no-senders (%p, %u)\n", port, mscount); - ipc_port_release_sonce(port); - } + (void)mach_notify_no_senders(port, mscount); + /* send-once right consumed */ } /* @@ -155,15 +156,12 @@ ipc_notify_no_senders( void ipc_notify_send_once( - ipc_port_t port) + ipc_port_t port) { - kern_return_t kr; + ipc_port_adjust_special_reply_port(port, IPC_PORT_ADJUST_RESET_BOOSTRAP_CHECKIN); - kr = mach_notify_send_once(port); - if (kr != KERN_SUCCESS) { - printf("dropped send-once (%p)\n", port); - ipc_port_release_sonce(port); - } + (void)mach_notify_send_once(port); + /* send-once right consumed */ } /* @@ -177,14 +175,9 @@ ipc_notify_send_once( void ipc_notify_dead_name( - ipc_port_t port, - mach_port_name_t name) + ipc_port_t port, + mach_port_name_t name) { - kern_return_t kr; - - kr = mach_notify_dead_name(port, name); - if (kr != KERN_SUCCESS) { - printf("dropped dead-name (%p, 0x%x)\n", port, name); - ipc_port_release_sonce(port); - } + (void)mach_notify_dead_name(port, name); + /* send-once right consumed */ }