source: rtems/c/src/lib/libbsp/powerpc/mvme5500/vectors/bspException.h @ 46a6fa91

4.104.114.84.95
Last change on this file since 46a6fa91 was 7be6ad9, checked in by Eric Norum <WENorum@…>, on 10/20/04 at 15:21:05

Add MVME550 BSP

  • Property mode set to 100644
File size: 1.8 KB
Line 
1#ifndef BSP_EXCEPTION_HANDLER_H
2#define BSP_EXCEPTION_HANDLER_H
3/* $Id$ */
4
5/* A slightly improved exception 'default' exception handler for RTEMS / SVGM */
6
7/* Author: Till Straumann <strauman@slac.stanford.edu>, 2002/5 */
8
9#include <bsp/vectors.h>
10
11/* Two types of exception intercepting / catching is supported:
12 *
13 *  - lowlevel handling (runs at IRQ level, before restoring any
14 *    task context).
15 *  - highlevel handling.
16 *
17 *  A lowlevel user hook is invoked twice, before and after processing
18 *  (printing) the exception.
19 *  If the user hook returns a nonzero value, normal processing
20 *  is skipped (including the second call to the hook)
21 *
22 *  If the hook returns nonzero to the second call, no default
23 *  'panic' occurs.
24 *
25 *  Default 'panic':
26 *   - if a task context is available:
27 *     - if a highlevel handler is installed, pass control
28 *       to the highlevel handler when returning from the
29 *       exception (the highlevel handler should probably
30 *       do a longjmp()). Otherwise:
31 *         - try to suspend interrupted task.
32 *   - hang if no task context is available.
33 *
34 */
35
36typedef struct BSP_ExceptionExtensionRec_ *BSP_ExceptionExtension;
37
38typedef int (*BSP_ExceptionHookProc)(BSP_Exception_frame *frame, BSP_ExceptionExtension ext, int after);
39
40typedef struct BSP_ExceptionExtensionRec_ {
41        BSP_ExceptionHookProc   lowlevelHook;
42        int                                             quiet;                  /* silence the exception handler */
43        void                                    (*highlevelHook)(BSP_ExceptionExtension);
44        /* user fields may be added after this */
45} BSP_ExceptionExtensionRec;
46
47#define SRR1_TEA_EXC    (1<<(31-13))
48#define SRR1_MCP_EXC    (1<<(31-12))
49
50void
51BSP_exceptionHandler(BSP_Exception_frame* excPtr);
52
53/* install an exception handler to the current task context */
54BSP_ExceptionExtension
55BSP_exceptionHandlerInstall(BSP_ExceptionExtension e);
56
57#endif
Note: See TracBrowser for help on using the repository browser.