Lines Matching full:exception
4 * This file contains all exception vectors (user, kernel, and double),
7 * exception occurs.
20 * We use a two-level table approach. The user and kernel exception vectors
21 * use a first-level dispatch table to dispatch the exception to a registered
23 * The default handler sets up a C-stack and dispatches the exception to a
36 * indicate that the exception is either a double or a regular exception:
38 * PT_DEPC >= VALID_DOUBLE_EXCEPTION_ADDRESS: double exception
39 * < VALID_DOUBLE_EXCEPTION_ADDRESS: regular exception
41 * Note: Neither the kernel nor the user exception handler generate literals.
60 * User exception vector. (Exceptions with PS.UM == 1, PS.EXCM == 0)
62 * We get here when an exception occurred while we were in userland.
64 * associated to the exception cause.
78 rsr a0, exccause # retrieve exception cause
79 s32i a0, a2, PT_DEPC # mark it as a regular exception
88 * Kernel exception vector. (Exceptions with PS.UM == 0, PS.EXCM == 0)
90 * We get this exception when we were already in kernel space.
92 * jump to the first-level handler associated with the exception cause.
105 rsr a0, exccause # retrieve exception cause
106 s32i a0, a2, PT_DEPC # mark it as a regular exception
115 * Double exception vector (Exceptions with PS.EXCM == 1)
116 * We get this exception when another exception occurs while were are
117 * already in an exception, such as window overflow/underflow exception,
118 * or 'expected' exceptions, for example memory exception when we were trying
124 * We decode the exception and take the appropriate action. However, the
125 * double exception vector is much more careful, because a lot more error
126 * cases go through the double exception vector than through the user and
127 * kernel exception vectors.
129 * Occasionally, the kernel expects a double exception to occur. This usually
132 * for immediate transfer of control to handle_double, where "normal" exception
134 * vmalloc memory, possibly requiring repair in a double exception handler.
139 * zero indicates to use the default kernel/user exception handler.
140 * There is only one exception, when the value is identical to the exc_table
147 * nonzero address of a fixup routine before it could cause a double exception
150 * Some other things to take care of when a fast exception handler doesn't
154 * exception handler should only use a2 as the stack pointer.
162 * - These registers must be saved before a double exception can occur.
182 * handler before it returns from the double exception.
184 * - Fixup handler can share the same exception frame with the fast handler.
187 * - Fixup handlers can jump to the default kernel and user exception
188 * handlers. Before it jumps, though, it has to setup a exception frame
191 * it instead of the exception address, so it can re-register itself as
196 * All registers a0...a15 are unchanged from the last exception, except:
205 * exception, so the item markt with (*) is not required.
215 /* Check for kernel double exception (usually fatal). */
224 /* Check if we are currently handling a window exception. */
235 /* Window overflow/underflow exception. Get stack pointer. */
239 /* Check for overflow/underflow exception, jump if overflow. */
244 * Restart window underflow exception.
253 * underflow exception. Therefore, we change window base to the value
254 * before we entered the window underflow exception and prepare the
255 * registers to return as if we were coming from a regular exception
273 s32i a0, a2, PT_DEPC # mark it as a regular exception
284 * We only allow the ITLB miss exception if we are in kernel space.
353 * Restart window OVERFLOW exception.
362 * overflow exception. Therefore, we change window base to the value
363 * before we entered the window overflow exception and prepare the
364 * registers to return as if we were coming from a regular exception
372 * a0 if the double exception was past the point where a0 was clobbered.
393 * a9/a13 gets a 2nd-level miss exception (not hardware TLB refill).
448 * Process the exception as a user exception as if it was
451 * This is similar to the user exception vector,
491 * Fixup handler for TLB miss in double exception handler for window owerflow.
498 * - set up exception stack to return back to appropriate a0 restore code
501 * - handle the exception;
508 * about the conditions of the original double exception that happened in
559 /* Need to preserve a0 value here to be able to handle exception
678 j _KernelExceptionVector # simulate kernel vector exception
680 j _UserExceptionVector # simulate user vector exception
689 * Note: We rerun the underflow handlers if we hit an exception, so