diff options
author | Eric Norum <WENorum@lbl.gov> | 2004-10-20 15:21:05 +0000 |
---|---|---|
committer | Eric Norum <WENorum@lbl.gov> | 2004-10-20 15:21:05 +0000 |
commit | 7be6ad9701934100d2929abbcce770da1e0a005f (patch) | |
tree | 5b8fc8b6cfcf0a61594e54f8fc2fafc6a4dc1a25 /c/src/lib/libbsp/powerpc/mvme5500/vectors/bspException.h | |
parent | 2004-10-20 Ralf Corsepius <ralf_corsepius@rtems.org> (diff) | |
download | rtems-7be6ad9701934100d2929abbcce770da1e0a005f.tar.bz2 |
Add MVME550 BSP
Diffstat (limited to 'c/src/lib/libbsp/powerpc/mvme5500/vectors/bspException.h')
-rw-r--r-- | c/src/lib/libbsp/powerpc/mvme5500/vectors/bspException.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/powerpc/mvme5500/vectors/bspException.h b/c/src/lib/libbsp/powerpc/mvme5500/vectors/bspException.h new file mode 100644 index 0000000000..0b03fb8f6c --- /dev/null +++ b/c/src/lib/libbsp/powerpc/mvme5500/vectors/bspException.h @@ -0,0 +1,57 @@ +#ifndef BSP_EXCEPTION_HANDLER_H +#define BSP_EXCEPTION_HANDLER_H +/* $Id$ */ + +/* A slightly improved exception 'default' exception handler for RTEMS / SVGM */ + +/* Author: Till Straumann <strauman@slac.stanford.edu>, 2002/5 */ + +#include <bsp/vectors.h> + +/* Two types of exception intercepting / catching is supported: + * + * - lowlevel handling (runs at IRQ level, before restoring any + * task context). + * - highlevel handling. + * + * A lowlevel user hook is invoked twice, before and after processing + * (printing) the exception. + * If the user hook returns a nonzero value, normal processing + * is skipped (including the second call to the hook) + * + * If the hook returns nonzero to the second call, no default + * 'panic' occurs. + * + * Default 'panic': + * - if a task context is available: + * - if a highlevel handler is installed, pass control + * to the highlevel handler when returning from the + * exception (the highlevel handler should probably + * do a longjmp()). Otherwise: + * - try to suspend interrupted task. + * - hang if no task context is available. + * + */ + +typedef struct BSP_ExceptionExtensionRec_ *BSP_ExceptionExtension; + +typedef int (*BSP_ExceptionHookProc)(BSP_Exception_frame *frame, BSP_ExceptionExtension ext, int after); + +typedef struct BSP_ExceptionExtensionRec_ { + BSP_ExceptionHookProc lowlevelHook; + int quiet; /* silence the exception handler */ + void (*highlevelHook)(BSP_ExceptionExtension); + /* user fields may be added after this */ +} BSP_ExceptionExtensionRec; + +#define SRR1_TEA_EXC (1<<(31-13)) +#define SRR1_MCP_EXC (1<<(31-12)) + +void +BSP_exceptionHandler(BSP_Exception_frame* excPtr); + +/* install an exception handler to the current task context */ +BSP_ExceptionExtension +BSP_exceptionHandlerInstall(BSP_ExceptionExtension e); + +#endif |