source: rtems/c/src/lib/libbsp/powerpc/mvme5500/vectors/bspException.h @ 183af89

4.115
Last change on this file since 183af89 was ac7af4a, checked in by Ralf Corsepius <ralf.corsepius@…>, on 11/30/09 at 04:37:44

Whitespace removal.

  • Property mode set to 100644
File size: 3.6 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/*
8 * Authorship
9 * ----------
10 * This software was created by
11 *     Till Straumann <strauman@slac.stanford.edu>, 5/2002,
12 *         Stanford Linear Accelerator Center, Stanford University.
13 *
14 * Acknowledgement of sponsorship
15 * ------------------------------
16 * This software was produced by
17 *     the Stanford Linear Accelerator Center, Stanford University,
18 *         under Contract DE-AC03-76SFO0515 with the Department of Energy.
19 *
20 * Government disclaimer of liability
21 * ----------------------------------
22 * Neither the United States nor the United States Department of Energy,
23 * nor any of their employees, makes any warranty, express or implied, or
24 * assumes any legal liability or responsibility for the accuracy,
25 * completeness, or usefulness of any data, apparatus, product, or process
26 * disclosed, or represents that its use would not infringe privately owned
27 * rights.
28 *
29 * Stanford disclaimer of liability
30 * --------------------------------
31 * Stanford University makes no representations or warranties, express or
32 * implied, nor assumes any liability for the use of this software.
33 *
34 * Stanford disclaimer of copyright
35 * --------------------------------
36 * Stanford University, owner of the copyright, hereby disclaims its
37 * copyright and all other rights in this software.  Hence, anyone may
38 * freely use it for any purpose without restriction.
39 *
40 * Maintenance of notices
41 * ----------------------
42 * In the interest of clarity regarding the origin and status of this
43 * SLAC software, this and all the preceding Stanford University notices
44 * are to remain affixed to any copy or derivative of this software made
45 * or distributed by the recipient and are to be affixed to any copy of
46 * software made or distributed by the recipient that contains a copy or
47 * derivative of this software.
48 *
49 * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03
50 */
51
52#include <bsp/vectors.h>
53
54/* Two types of exception intercepting / catching is supported:
55 *
56 *  - lowlevel handling (runs at IRQ level, before restoring any
57 *    task context).
58 *  - highlevel handling.
59 *
60 *  A lowlevel user hook is invoked twice, before and after processing
61 *  (printing) the exception.
62 *  If the user hook returns a nonzero value, normal processing
63 *  is skipped (including the second call to the hook)
64 *
65 *  If the hook returns nonzero to the second call, no default
66 *  'panic' occurs.
67 *
68 *  Default 'panic':
69 *   - if a task context is available:
70 *     - if a highlevel handler is installed, pass control
71 *       to the highlevel handler when returning from the
72 *       exception (the highlevel handler should probably
73 *       do a longjmp()). Otherwise:
74 *         - try to suspend interrupted task.
75 *   - hang if no task context is available.
76 *
77 */
78
79typedef struct BSP_ExceptionExtensionRec_ *BSP_ExceptionExtension;
80
81typedef int (*BSP_ExceptionHookProc)(BSP_Exception_frame *frame, BSP_ExceptionExtension ext, int after);
82
83typedef struct BSP_ExceptionExtensionRec_ {
84        BSP_ExceptionHookProc   lowlevelHook;
85        int                                             quiet;                  /* silence the exception handler */
86        void                                    (*highlevelHook)(BSP_ExceptionExtension);
87        /* user fields may be added after this */
88} BSP_ExceptionExtensionRec;
89
90#define SRR1_TEA_EXC    (1<<(31-13))
91#define SRR1_MCP_EXC    (1<<(31-12))
92
93void
94BSP_exceptionHandler(BSP_Exception_frame* excPtr);
95
96/* install an exception handler to the current task context */
97BSP_ExceptionExtension
98BSP_exceptionHandlerInstall(BSP_ExceptionExtension e);
99
100#endif
Note: See TracBrowser for help on using the repository browser.