X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/6601e61aa18bf4f09af135ff61fc7f4771d23b06..4d15aeb193b2c68f1d38666c317f8d3734f5f083:/osfmk/ipc/ipc_right.h

diff --git a/osfmk/ipc/ipc_right.h b/osfmk/ipc/ipc_right.h
index 0623ba61c..a3d4af17e 100644
--- a/osfmk/ipc/ipc_right.h
+++ b/osfmk/ipc/ipc_right.h
@@ -1,23 +1,29 @@
 /*
  * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
  *
- * @APPLE_LICENSE_HEADER_START@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
- * The contents of this file constitute Original Code as defined in and
- * are subject to the Apple Public Source License Version 1.1 (the
- * "License").  You may not use this file except in compliance with the
- * License.  Please obtain a copy of the License at
- * http://www.apple.com/publicsource and read it before using this file.
+ * 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
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * 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.
  * 
- * This Original Code and all software distributed under the License are
- * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * 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,
  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
- * License for the specific language governing rights and limitations
- * under the License.
+ * 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_LICENSE_HEADER_END@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
  */
 /*
  * @OSF_COPYRIGHT@
@@ -89,24 +95,25 @@ extern boolean_t ipc_right_reverse(
 	mach_port_name_t	*namep,
 	ipc_entry_t		*entryp);
 
-/* Make a dead-name request, returning the registered send-once right */
-extern kern_return_t ipc_right_dnrequest(
+/* Make a notification request, returning the previous send-once right */
+extern kern_return_t ipc_right_request_alloc(
 	ipc_space_t		space,
 	mach_port_name_t	name,
 	boolean_t		immediate,
+	boolean_t		send_possible,
 	ipc_port_t		notify,
 	ipc_port_t		*previousp);
 
-/* Cancel a dead-name request and return the send-once right */
-extern ipc_port_t ipc_right_dncancel(
+/* Cancel a notification request and return the send-once right */
+extern ipc_port_t ipc_right_request_cancel(
 	ipc_space_t		space,
 	ipc_port_t		port,
 	mach_port_name_t	name,
 	ipc_entry_t		entry);
 
-#define	ipc_right_dncancel_macro(space, port, name, entry)		\
-		 ((entry->ie_request == 0) ? IP_NULL :			\
-		 ipc_right_dncancel((space), (port), (name), (entry)))
+#define	ipc_right_request_cancel_macro(space, port, name, entry)		\
+		 ((entry->ie_request == IE_REQ_NONE) ? IP_NULL :		\
+		 ipc_right_request_cancel((space), (port), (name), (entry)))
 
 /* Check if an entry is being used */
 extern boolean_t ipc_right_inuse(
@@ -122,7 +129,7 @@ extern boolean_t ipc_right_check(
 	ipc_entry_t		entry);
 
 /* Clean up an entry in a dead space */
-extern void ipc_right_clean(
+extern void ipc_right_terminate(
 	ipc_space_t		space,
 	mach_port_name_t	name,
 	ipc_entry_t		entry);
@@ -131,7 +138,9 @@ extern void ipc_right_clean(
 extern kern_return_t ipc_right_destroy(
 	ipc_space_t		space,
 	mach_port_name_t	name,
-	ipc_entry_t		entry);
+	ipc_entry_t		entry,
+	boolean_t		check_guard,
+	uint64_t		guard);
 
 /* Release a send/send-once/dead-name user reference */
 extern kern_return_t ipc_right_dealloc(
@@ -147,6 +156,14 @@ extern kern_return_t ipc_right_delta(
 	mach_port_right_t	right,
 	mach_port_delta_t	delta);
 
+/* Destroy a receive right; Modify ref count for send rights */
+extern kern_return_t ipc_right_destruct(
+	ipc_space_t		space,
+	mach_port_name_t	name,
+	ipc_entry_t		entry,
+	mach_port_delta_t	srdelta,
+	uint64_t		guard);
+
 /* Retrieve information about a right */
 extern kern_return_t ipc_right_info(
 	ipc_space_t		space,
@@ -170,7 +187,9 @@ extern kern_return_t ipc_right_copyin(
 	mach_msg_type_name_t	msgt_name,
 	boolean_t		deadok,
 	ipc_object_t		*objectp,
-	ipc_port_t		*sorightp);
+	ipc_port_t		*sorightp,
+	ipc_port_t		*releasep,
+	int			*assertcntp);
 
 /* Undo the effects of an ipc_right_copyin */
 extern void ipc_right_copyin_undo(
@@ -181,13 +200,16 @@ extern void ipc_right_copyin_undo(
 	ipc_object_t		object,
 	ipc_port_t		soright);
 
-/* Copyin two send rights from a space */
+/* Copyin a pair of dispositions from a space */
 extern kern_return_t ipc_right_copyin_two(
 	ipc_space_t		space,
 	mach_port_name_t	name,
 	ipc_entry_t		entry,
+	mach_msg_type_name_t	msgt_one,
+	mach_msg_type_name_t	msgt_two,
 	ipc_object_t		*objectp,
-	ipc_port_t		*sorightp);
+	ipc_port_t		*sorightp,
+	ipc_port_t		*releasep);
 
 /* Copyout a capability to a space */
 extern kern_return_t ipc_right_copyout(