summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i960/rxgen960/startup/fault.h
blob: a0b6bd74606d816ba9884f37313a11775adaacc0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*-------------------------------------*/
/* fault.h                             */
/* Last change :  2.11.94              */
/*-------------------------------------*/
/*
 *  $Id$
 */

#ifndef _FAULT_H_
#define _FAULT_H_

  /* (RAM-based) Fault Handler.
   * Is invoked when there is no chance to repair current state. 
   */
extern void faultBad(int invokedFromRom,
                     unsigned int inst, unsigned int * faultBuffer, 
                     unsigned int type, unsigned int sbtp);
  /* (RAM-based) Fault Handler.
   * Is invoked when there is a chance to repair current state. 
   */
extern void faultGood(unsigned int instr, unsigned int * faultBuffer, 
                      unsigned int type, unsigned int sbtp);
  /* Some addresses that are defined in rom.ld.
   */
extern unsigned int faultCheckSum;

extern unsigned int faultBuffer[];

extern unsigned int faultStart[];
extern unsigned int faultEnd[];   
  /* Interface for user to register fault handlers of his own.
   * Fault names.
   */
#define ParallelFLT	0
#define TraceFLT	1
#define OperationFLT	2
#define ArithmeticFLT	3
#define ConstraintFLT	5
#define ProtectionFLT	7
#define TypeFLT		9  
  /* User-registered fault handler.
   */
typedef void (* UserFaultHandler)(unsigned int inst, unsigned int * faultBuf, 
                                  unsigned int type, unsigned int sbtp);
  /* Register user-defined fault handler. The third argument is
   * how many times this fault handler will be valid. This to avoid
   * the situation when handler is bad and it causes a fault itself.
   */
extern int faultRegister(int fault, UserFaultHandler, int cnt);
  /* Validate handler for one more time.
   */
extern int faultOk(int fault);
                       
#endif
/*-------------*/
/* End of file */
/*-------------*/