]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/man/task_swap_exception_ports.html
xnu-792.6.76.tar.gz
[apple/xnu.git] / osfmk / man / task_swap_exception_ports.html
index 481cd779025d65be6644cc2f96dc9a59fd0a90f7..cfcb41986a31c05e154e964aae9ae28b93c03cf3 100755 (executable)
@@ -1 +1,176 @@
-<h2>task_swap_exception_ports</h2>\r<hr>\r<p>\r<strong>Function</strong> - Set target task's exception ports, returning the previous exception ports.\r<h3>SYNOPSIS</h3>\r<pre>\r<strong>kern_return_t   task_swap_exception_ports</strong>\r                <strong>(task_t</strong>                                    <var>task</var>,\r                 <strong>exception_mask_t</strong>               <var>exception_types</var>,\r                 <strong>mach_port_t</strong>                     <var>exception_port</var>,\r                 <strong>exception_behavior_t</strong>                  <var>behavior</var>,\r                 <strong>thread_state_flavor_t</strong>                   <var>flavor</var>,\r                 <strong>exception_mask_array_t</strong>     <var>old_exception_masks</var>,\r                 <strong>old_exception_masks</strong>        <var>old_exception_count</var>,\r                 <strong>exception_port_array_t</strong>     <var>old_exception_ports</var>,\r                 <strong>exception_behavior_array_t</strong>       <var>old_behaviors</var>,\r                 <strong>exception_flavor_array_t</strong>           <var>old_flavors</var><strong>);</strong>\r</pre>\r<h3>PARAMETERS</h3>\r<dl>\r<p>\r<dt> <var>task</var> \r<dd>\r[in task send right]\rThe task for which to set the ports.\r<p>\r<dt> <var>exception_types</var> \r<dd>\r[in scalar]\rA flag word indicating the types of exceptions for which the \rexception port applies:\r<dl>\r<p>\r<dt> <strong>EXC_MASK_BAD_ACCESS</strong>\r<dd>\rCould not access memory.\r<p>\r<dt> <strong>EXC_MASK_BAD_INSTRUCTION</strong>\r<dd>\rInstruction failed.  Illegal or undefined instruction or operand.\r<p>\r<dt> <strong>EXC_MASK_ARITHMETIC</strong>\r<dd>\rArithmetic exception\r<p>\r<dt> <strong>EXC_MASK_EMULATION</strong>\r<dd>\rEmulation instruction.  Emulation support instruction\rencountered.\r<p>\r<dt> <strong>EXC_MASK_SOFTWARE</strong>\r<dd>\rSoftware generated exception.\r<p>\r<dt> <strong>EXC_MASK_BREAKPOINT</strong>\r<dd>\rTrace, breakpoint, etc.\r<p>\r<dt> <strong>EXC_MASK_SYSCALL</strong>\r<dd>\rSystem call requested.\r<p>\r<dt> <strong>EXC_MASK_MACH_SYSCALL</strong>\r<dd>\rSystem call with a number in the Mach call range requested.\r<p>\r<dt> <strong>EXC_MASK_RPC_ALERT   </strong>\r<dd>\rExceptional condition encountered during execution of RPC.\r</dl>\r<p>\r<dt> <var>exception_port</var> \r<dd>\r[in exception send right]\rThe exception port for all selected exception \rtypes.\r<p>\r<dt> <var>behavior</var> \r<dd>\r[in scalar]\rThe type of exception message to be sent.  Defined types are:\r<dl>\r<p>\r<dt> <strong>EXCEPTION_DEFAULT</strong>\r<dd>\rSend a <strong>catch_exception_raise</strong> message including the thread \ridentity.\r<p>\r<dt> <strong>EXCEPTION_STATE</strong>\r<dd>\rSend a <strong>catch_exception_raise_state</strong> message including the \rthread state.\r<p>\r<dt> <strong>EXCEPTION_STATE_PROTECTED</strong>\r<dd>\rSend a <strong>catch_exception_raise_state</strong> message including the \rthread state.  Mark the exception port (and associated\rexceptions) as protected.\r<p>\r<dt> <strong>EXCEPTION_STATE_IDENTITY</strong>\r<dd>\rSend a <strong>catch_exception_raise_state_identity</strong> message\rincluding the thread identity and state.\r<p>\r<dt> <strong>EXCEPTION_STATE_IDENTITY_PROTECTED</strong>\r<dd>\rSend a <strong>catch_exception_raise_state_identity</strong> message\rincluding the thread identity and state.  Mark the exception port \r(and associated exceptions) as protected.\r</dl>\r<p>\r<dt> <var>flavor</var> \r<dd>\r[in scalar]\rThe type of state to be sent with the exception message. \rThese types are defined in <strong>&ltmach/thread_states.h&gt</strong>.\r<p>\r<dt> <var>old_exception_masks</var> \r<dd>\r[out array of <var>exception_mask_t</var>]\rAn array, each element being a mask \rspecifying for which exception types the corresponding element of the \rother arrays apply.\r<p>\r<dt> <var>old_exception_count</var> \r<dd>\r[pointer to in/out scalar]\rOn input, the maximum size of the array\rbuffers; on output, the number of returned <exception type mask,\rexception port, behavior, flavor> sets returned.\r<p>\r<dt> <var>old_exception_ports</var> \r<dd>\r[out array of exception send rights]\rThe returned exception ports.\r<p>\r<dt> <var>old_behaviors</var> \r<dd>\r[out array of <var>exception_behavior_t</var>]\rThe type of exception message to \rbe sent as with <var>behavior</var>.\r<p>\r<dt> <var>old_flavors</var> \r<dd>\r[out array of <var>thread_state_flavor_t</var>]\rThe type of state to be sent with \rthe exception message.  These types are defined in  <strong>&ltmach/thread_states.h&gt</strong>.\r</dl>\r<h3>DESCRIPTION</h3>\r<p>\rThe <strong>task_swap_exception_ports</strong> function sets a specified\rset of exception \rports belonging to <var>task</var>, returning the old set.  A task exception\rport is used when \ra thread specific exception port returns a non-success reply.\r<h3>NOTES</h3>\r<p>\rIf the value of the <strong>EXC_MACH_SYSCALL</strong> exception class exception port is \rthe host name port, Mach kernel traps are executed by the kernel as expected; \rany other value causes the attempted execution of these system call numbers to \rbe considered an exception.\r<h3>RETURN VALUES</h3>\r<p>\rOnly generic errors apply.\r<h3>RELATED INFORMATION</h3>\r<p>\rFunctions:\r<a href="mach_task_self.html"><strong>mach_task_self</strong></a>,\r<a href="task_get_exception_ports.html"><strong>task_get_exception_ports</strong></a>,\r<a href="task_set_exception_ports.html"><strong>task_set_exception_ports</strong></a>,\r<a href="thread_create.html"><strong>thread_create</strong></a>,\r<a href="thread_get_exception_ports.html"><strong>thread_get_exception_ports</strong></a>,\r<a href="thread_set_exception_ports.html"><strong>thread_set_exception_ports</strong></a>,\r<a href="TS_exception_ports.html"><strong>thread_swap_exception_ports</strong></a>,\r<a href="catch_exception_raise.html"><strong>catch_exception_raise</strong></a>,\r<a href="thread_abort.html"><strong>thread_abort</strong></a>.\r
\ No newline at end of file
+<h2>task_swap_exception_ports</h2>
+<hr>
+<p>
+<strong>Function</strong> - Set target task's exception ports, returning the previous exception ports.
+<h3>SYNOPSIS</h3>
+<pre>
+<strong>kern_return_t   task_swap_exception_ports</strong>
+                <strong>(task_t</strong>                                    <var>task</var>,
+                 <strong>exception_mask_t</strong>               <var>exception_types</var>,
+                 <strong>mach_port_t</strong>                     <var>exception_port</var>,
+                 <strong>exception_behavior_t</strong>                  <var>behavior</var>,
+                 <strong>thread_state_flavor_t</strong>                   <var>flavor</var>,
+                 <strong>exception_mask_array_t</strong>     <var>old_exception_masks</var>,
+                 <strong>old_exception_masks</strong>        <var>old_exception_count</var>,
+                 <strong>exception_port_array_t</strong>     <var>old_exception_ports</var>,
+                 <strong>exception_behavior_array_t</strong>       <var>old_behaviors</var>,
+                 <strong>exception_flavor_array_t</strong>           <var>old_flavors</var><strong>);</strong>
+</pre>
+<h3>PARAMETERS</h3>
+<dl>
+<p>
+<dt> <var>task</var> 
+<dd>
+[in task send right]
+The task for which to set the ports.
+<p>
+<dt> <var>exception_types</var> 
+<dd>
+[in scalar]
+A flag word indicating the types of exceptions for which the 
+exception port applies:
+<dl>
+<p>
+<dt> <strong>EXC_MASK_BAD_ACCESS</strong>
+<dd>
+Could not access memory.
+<p>
+<dt> <strong>EXC_MASK_BAD_INSTRUCTION</strong>
+<dd>
+Instruction failed.  Illegal or undefined instruction or operand.
+<p>
+<dt> <strong>EXC_MASK_ARITHMETIC</strong>
+<dd>
+Arithmetic exception
+<p>
+<dt> <strong>EXC_MASK_EMULATION</strong>
+<dd>
+Emulation instruction.  Emulation support instruction
+encountered.
+<p>
+<dt> <strong>EXC_MASK_SOFTWARE</strong>
+<dd>
+Software generated exception.
+<p>
+<dt> <strong>EXC_MASK_BREAKPOINT</strong>
+<dd>
+Trace, breakpoint, etc.
+<p>
+<dt> <strong>EXC_MASK_SYSCALL</strong>
+<dd>
+System call requested.
+<p>
+<dt> <strong>EXC_MASK_MACH_SYSCALL</strong>
+<dd>
+System call with a number in the Mach call range requested.
+<p>
+<dt> <strong>EXC_MASK_RPC_ALERT        </strong>
+<dd>
+Exceptional condition encountered during execution of RPC.
+</dl>
+<p>
+<dt> <var>exception_port</var> 
+<dd>
+[in exception send right]
+The exception port for all selected exception 
+types.
+<p>
+<dt> <var>behavior</var> 
+<dd>
+[in scalar]
+The type of exception message to be sent.  Defined types are:
+<dl>
+<p>
+<dt> <strong>EXCEPTION_DEFAULT</strong>
+<dd>
+Send a <strong>catch_exception_raise</strong> message including the thread 
+identity.
+<p>
+<dt> <strong>EXCEPTION_STATE</strong>
+<dd>
+Send a <strong>catch_exception_raise_state</strong> message including the 
+thread state.
+<p>
+<dt> <strong>EXCEPTION_STATE_PROTECTED</strong>
+<dd>
+Send a <strong>catch_exception_raise_state</strong> message including the 
+thread state.  Mark the exception port (and associated
+exceptions) as protected.
+<p>
+<dt> <strong>EXCEPTION_STATE_IDENTITY</strong>
+<dd>
+Send a <strong>catch_exception_raise_state_identity</strong> message
+including the thread identity and state.
+<p>
+<dt> <strong>EXCEPTION_STATE_IDENTITY_PROTECTED</strong>
+<dd>
+Send a <strong>catch_exception_raise_state_identity</strong> message
+including the thread identity and state.  Mark the exception port 
+(and associated exceptions) as protected.
+</dl>
+<p>
+<dt> <var>flavor</var> 
+<dd>
+[in scalar]
+The type of state to be sent with the exception message. 
+These types are defined in <strong>&ltmach/thread_states.h&gt</strong>.
+<p>
+<dt> <var>old_exception_masks</var> 
+<dd>
+[out array of <var>exception_mask_t</var>]
+An array, each element being a mask 
+specifying for which exception types the corresponding element of the 
+other arrays apply.
+<p>
+<dt> <var>old_exception_count</var> 
+<dd>
+[pointer to in/out scalar]
+On input, the maximum size of the array
+buffers; on output, the number of returned <exception type mask,
+exception port, behavior, flavor> sets returned.
+<p>
+<dt> <var>old_exception_ports</var> 
+<dd>
+[out array of exception send rights]
+The returned exception ports.
+<p>
+<dt> <var>old_behaviors</var> 
+<dd>
+[out array of <var>exception_behavior_t</var>]
+The type of exception message to 
+be sent as with <var>behavior</var>.
+<p>
+<dt> <var>old_flavors</var> 
+<dd>
+[out array of <var>thread_state_flavor_t</var>]
+The type of state to be sent with 
+the exception message.  These types are defined in  <strong>&ltmach/thread_states.h&gt</strong>.
+</dl>
+<h3>DESCRIPTION</h3>
+<p>
+The <strong>task_swap_exception_ports</strong> function sets a specified
+set of exception 
+ports belonging to <var>task</var>, returning the old set.  A task exception
+port is used when 
+a thread specific exception port returns a non-success reply.
+<h3>NOTES</h3>
+<p>
+If the value of the <strong>EXC_MACH_SYSCALL</strong> exception class exception port is 
+the host name port, Mach kernel traps are executed by the kernel as expected; 
+any other value causes the attempted execution of these system call numbers to 
+be considered an exception.
+<h3>RETURN VALUES</h3>
+<p>
+Only generic errors apply.
+<h3>RELATED INFORMATION</h3>
+<p>
+Functions:
+<a href="mach_task_self.html"><strong>mach_task_self</strong></a>,
+<a href="task_get_exception_ports.html"><strong>task_get_exception_ports</strong></a>,
+<a href="task_set_exception_ports.html"><strong>task_set_exception_ports</strong></a>,
+<a href="thread_create.html"><strong>thread_create</strong></a>,
+<a href="thread_get_exception_ports.html"><strong>thread_get_exception_ports</strong></a>,
+<a href="thread_set_exception_ports.html"><strong>thread_set_exception_ports</strong></a>,
+<a href="TS_exception_ports.html"><strong>thread_swap_exception_ports</strong></a>,
+<a href="catch_exception_raise.html"><strong>catch_exception_raise</strong></a>,
+<a href="thread_abort.html"><strong>thread_abort</strong></a>.