]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/mach/mach_port.defs
xnu-6153.11.26.tar.gz
[apple/xnu.git] / osfmk / mach / mach_port.defs
index 6c612758d1667305bb1238f364919f1af3e6db6e..ea3328933de73c099e427beef7a7de4b9b0de3f5 100644 (file)
@@ -68,6 +68,10 @@ subsystem
 #endif /* KERNEL_SERVER */
          mach_port 3200;
 
+#if !KERNEL && !LIBSYSCALL_INTERFACE
+       UserPrefix _kernelrpc_;
+#endif
+
 #include <mach/std_types.defs>
 #include <mach/mach_types.defs>
 #include <mach_debug/mach_debug_types.defs>
@@ -98,6 +102,9 @@ routine mach_port_type(
  *     Changes the name by which a port (or port set) is known to
  *     the target task.  The new name can't be in use.  The
  *     old name becomes available for recycling.
+ *
+ *     This interface is OBSOLETE and will always
+ *     return KERN_NOT_SUPPORTED.
  */
 
 routine mach_port_rename(
@@ -201,7 +208,30 @@ routine mach_port_mod_refs(
                right           : mach_port_right_t;
                delta           : mach_port_delta_t);
 
-skip;
+/*
+ *     Peek at the message queue for the specified receive
+ *     right and return info about the message with the
+ *     sequence number matching the input.  If zero is
+ *     specified as the seqno, the first message in the
+ *     queue will be peeked.
+ *
+ *     Only the following trailer types are currently supported:
+ *          MACH_RCV_TRAILER_TYPE(MACH_MSG_TRAILER_FORMAT_0)
+ *
+ *             or'ed with one of these element types:
+ *          MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_NULL)
+ *          MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_SEQNO)
+ *          MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_SENDER)
+ *          MACH_RCV_TRAILER_ELEMENTS(MACH_RCV_TRAILER_AUDIT)
+ */
+routine mach_port_peek(
+               task            : ipc_space_t;
+               name            : mach_port_name_t;
+               trailer_type    : mach_msg_trailer_type_t;
+ inout         request_seqnop  : mach_port_seqno_t;
+ out           msg_sizep       : mach_msg_size_t;
+ out           msg_idp         : mach_msg_id_t;
+ out           trailer_infop   : mach_msg_trailer_info_t, CountInOut);         
 
 /*
  *     Only valid for receive rights.
@@ -218,7 +248,7 @@ routine mach_port_set_mscount(
  */
 
 routine mach_port_get_set_status(
-               task            : ipc_space_t;
+               task            : ipc_space_inspect_t;
                name            : mach_port_name_t;
        out     members         : mach_port_name_array_t);
 
@@ -324,7 +354,7 @@ routine mach_port_set_seqno(
  */
 
 routine mach_port_get_attributes(
-               task            : ipc_space_t;
+               task            : ipc_space_inspect_t;
                name            : mach_port_name_t;
                flavor          : mach_port_flavor_t;
        out     port_info_out   : mach_port_info_t, CountInOut);
@@ -395,7 +425,7 @@ routine     mach_port_get_srights(
  *      Otherwise, KERN_FAILURE is returned.
  */
 routine mach_port_space_info(
-               task            : ipc_space_t;
+               task            : ipc_space_inspect_t;
        out     space_info      : ipc_info_space_t;
        out     table_info      : ipc_info_name_array_t;
        out     tree_info       : ipc_info_tree_name_array_t);
@@ -422,7 +452,7 @@ routine mach_port_dnrequest_info(
  *     mach_port_kernel_object64() call (see below).
  */
 routine        mach_port_kernel_object(
-               task            : ipc_space_t;
+               task            : ipc_space_inspect_t;
                name            : mach_port_name_t;
        out     object_type     : unsigned;
        out     object_addr     : unsigned);
@@ -473,9 +503,14 @@ routine mach_port_extract_member(
  */
 
 routine mach_port_get_context(
-               task            : ipc_space_t;
+               task            : ipc_space_inspect_t;
                name            : mach_port_name_t;
-       out context             : mach_vm_address_t);
+#ifdef LIBSYSCALL_INTERFACE
+       out context             : mach_port_context_t
+#else
+       out context             : mach_vm_address_t
+#endif
+       );
 
 /*
  * Only valid for receive rights.
@@ -485,7 +520,12 @@ routine mach_port_get_context(
 routine mach_port_set_context(
                task            : ipc_space_t;
                name            : mach_port_name_t;
-               context         : mach_vm_address_t);
+#ifdef LIBSYSCALL_INTERFACE
+               context         : mach_port_context_t
+#else
+               context         : mach_vm_address_t
+#endif
+               );
 
 /*
  *     Return the type and address of the kernel object
@@ -494,10 +534,128 @@ routine mach_port_set_context(
  *      Otherwise, KERN_FAILURE is returned.
  */
 routine        mach_port_kobject(
-               task            : ipc_space_t;
+               task            : ipc_space_inspect_t;
                name            : mach_port_name_t;
        out     object_type     : natural_t;
        out     object_addr     : mach_vm_address_t);
 
 
+/*
+ *     Constructs a right based on the options passed
+ *     in. Also allows guarding the port as one of the
+ *     options if the requested right is a receive
+ *     right.
+ */
+routine mach_port_construct(
+               task            : ipc_space_t;
+               options         : mach_port_options_ptr_t;
+#ifdef LIBSYSCALL_INTERFACE
+               context         : mach_port_context_t;
+#else
+               context         : uint64_t;
+#endif
+       out     name            : mach_port_name_t);
+
+/*
+ *     Destroys a mach port using the guard provided
+ *     for guarded ports. Also reduces the user ref
+ *     count for send rights as specified by srdelta.
+ */
+routine mach_port_destruct(
+               task            : ipc_space_t;
+               name            : mach_port_name_t;
+               srdelta         : mach_port_delta_t;
+#ifdef LIBSYSCALL_INTERFACE
+               guard           : mach_port_context_t
+#else
+               guard           : uint64_t
+#endif         
+               );
+
+/*
+ *     Guard an already existing port. Allows guarding
+ *     receive rights only. Uses the context field in the
+ *     port structure to store the guard.
+ */
+routine mach_port_guard(
+               task            : ipc_space_t;
+               name            : mach_port_name_t;
+#ifdef LIBSYSCALL_INTERFACE
+               guard           : mach_port_context_t;
+#else
+               guard           : uint64_t;
+#endif 
+               strict          : boolean_t);
+
+/*
+ *     Unguard a port guarded previously. For unguarded ports
+ *     or incorrect guards passed in it raises an exception
+ *     indicating guarding misbehavior.
+ */
+routine mach_port_unguard(
+               task            : ipc_space_t;
+               name            : mach_port_name_t;
+#ifdef LIBSYSCALL_INTERFACE
+               guard           : mach_port_context_t
+#else
+               guard           : uint64_t
+#endif 
+               );
+
+/*
+ *     Returns basic information about an IPC space.
+ *      This call is only valid on MACH_IPC_DEBUG kernels.
+ *      Otherwise, KERN_FAILURE is returned.
+ */
+routine mach_port_space_basic_info(
+               task            : ipc_space_inspect_t;
+       out     basic_info      : ipc_info_space_basic_t);
+
+#if KERNEL || !LIBSYSCALL_INTERFACE
+/*
+ *     Returns sync ipc turnstile link status
+ *     for special reply ports.
+ */
+routine mach_port_special_reply_port_reset_link(
+               task            : ipc_space_t;
+               name            : mach_port_name_t;
+       out     srp_lost_link   : boolean_t);
+#else
+skip;
+#endif
+
+/*
+ *     Guard an already existing port. Allows guarding
+ *     receive rights only. Uses the context field in the
+ *     port structure to store the guard.
+ */
+routine mach_port_guard_with_flags(
+               task            : ipc_space_t;
+               name            : mach_port_name_t;
+#ifdef LIBSYSCALL_INTERFACE
+               guard           : mach_port_context_t;
+#else
+               guard           : uint64_t;
+#endif
+               flags           : uint64_t);
+
+/*
+ *     Swap guard value of an existing guarded port. Works
+ *     only if it is not a strict guard.
+ */
+routine mach_port_swap_guard(
+               task            : ipc_space_t;
+               name            : mach_port_name_t;
+#ifdef LIBSYSCALL_INTERFACE
+               old_guard       : mach_port_context_t;
+#else
+               old_guard       : uint64_t;
+#endif
+
+#ifdef LIBSYSCALL_INTERFACE
+               new_guard       : mach_port_context_t);
+#else
+               new_guard       : uint64_t);
+#endif
+
 /* vim: set ft=c : */