X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/d9a64523371fa019c4575bb400cbbc3a50ac9903..f427ee49d309d8fc33ebf3042c3a775f2f530ded:/osfmk/mach/mach_port.defs diff --git a/osfmk/mach/mach_port.defs b/osfmk/mach/mach_port.defs index 5bc503421..969fad546 100644 --- a/osfmk/mach/mach_port.defs +++ b/osfmk/mach/mach_port.defs @@ -76,6 +76,8 @@ subsystem #include #include +type kobject_description_t = c_string[*:512]; + /* * Returns the set of port and port set names * to which the target task has access, along with @@ -246,9 +248,14 @@ routine mach_port_set_mscount( * Only valid for port sets. Returns a list of * the members. */ - -routine mach_port_get_set_status( - task : ipc_space_inspect_t; +routine +#ifdef KERNEL_SERVER +mach_port_get_set_status_from_user( + port : mach_port_t; +#else +mach_port_get_set_status( + task : ipc_space_read_t; +#endif name : mach_port_name_t; out members : mach_port_name_array_t); @@ -352,9 +359,14 @@ routine mach_port_set_seqno( /* * Returns information about a port. */ - -routine mach_port_get_attributes( - task : ipc_space_inspect_t; +routine +#ifdef KERNEL_SERVER +mach_port_get_attributes_from_user( + port : mach_port_t; +#else +mach_port_get_attributes( + task : ipc_space_read_t; +#endif name : mach_port_name_t; flavor : mach_port_flavor_t; out port_info_out : mach_port_info_t, CountInOut); @@ -424,8 +436,14 @@ routine mach_port_get_srights( * This call is only valid on MACH_IPC_DEBUG kernels. * Otherwise, KERN_FAILURE is returned. */ -routine mach_port_space_info( - task : ipc_space_inspect_t; +routine +#ifdef KERNEL_SERVER +mach_port_space_info_from_user( + port : mach_port_t; +#else +mach_port_space_info( + space : ipc_space_read_t; +#endif out space_info : ipc_info_space_t; out table_info : ipc_info_name_array_t; out tree_info : ipc_info_tree_name_array_t); @@ -451,8 +469,14 @@ routine mach_port_dnrequest_info( * This interface is DEPRECATED in favor of the new * mach_port_kernel_object64() call (see below). */ -routine mach_port_kernel_object( - task : ipc_space_inspect_t; +routine +#ifdef KERNEL_SERVER +mach_port_kernel_object_from_user( + port : mach_port_t; +#else +mach_port_kernel_object( + task : ipc_space_read_t; +#endif name : mach_port_name_t; out object_type : unsigned; out object_addr : unsigned); @@ -501,9 +525,14 @@ routine mach_port_extract_member( * Only valid for receive rights. * Gets the context pointer for the port. */ - -routine mach_port_get_context( - task : ipc_space_inspect_t; +routine +#ifdef KERNEL_SERVER +mach_port_get_context_from_user( + port : mach_port_t; +#else +mach_port_get_context( + task : ipc_space_read_t; +#endif name : mach_port_name_t; #ifdef LIBSYSCALL_INTERFACE out context : mach_port_context_t @@ -533,8 +562,14 @@ routine mach_port_set_context( * This call is only valid on MACH_IPC_DEBUG kernels. * Otherwise, KERN_FAILURE is returned. */ -routine mach_port_kobject( - task : ipc_space_inspect_t; +routine +#ifdef KERNEL_SERVER +mach_port_kobject_from_user( + port : mach_port_t; +#else +mach_port_kobject( + task : ipc_space_read_t; +#endif name : mach_port_name_t; out object_type : natural_t; out object_addr : mach_vm_address_t); @@ -623,4 +658,58 @@ routine mach_port_special_reply_port_reset_link( #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 + +/* + * Return the type and address of the kernel object + * that the given send/receive right represents. + * This call is only valid on MACH_IPC_DEBUG kernels. + * Otherwise, KERN_FAILURE is returned. + */ +routine +#ifdef KERNEL_SERVER +mach_port_kobject_description_from_user( + port : mach_port_t; +#else +mach_port_kobject_description( + task : ipc_space_read_t; +#endif + name : mach_port_name_t; + out object_type : natural_t; + out object_addr : mach_vm_address_t; + out description : kobject_description_t); + /* vim: set ft=c : */