OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_47/] [or1ksim/] [cpu/] [or1k/] [except.h] - Blame information for rev 437

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 33 lampret
/* except.h -- OR1K architecture specific exceptions
2
   Copyright (C) 1999 Damjan Lampret, lampret@opencores.org
3
 
4
This file is part of OpenRISC 1000 Architectural Simulator.
5
 
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
10
 
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
GNU General Public License for more details.
15
 
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
19
 
20 437 simons
#ifndef _EXCEPT_H_
21
#define _EXCEPT_H_
22 33 lampret
/* Prototypes */
23
void except_handle(int except, unsigned long ea);
24
 
25
 
26
/* Define if you want pure virtual machine simulation (no exceptions etc.) */
27 99 lampret
#define ONLY_VIRTUAL_MACHINE 0
28 33 lampret
 
29
/* Definition of OR1K exceptions */
30
 
31
#define EXCEPT_RESET    0x0100
32
#define EXCEPT_BUSERR   0x0200
33
#define EXCEPT_DPF      0x0300
34
#define EXCEPT_IPF      0x0400
35 102 lampret
#define EXCEPT_LPINT    0x0500
36 33 lampret
#define EXCEPT_ALIGN    0x0600
37
#define EXCEPT_ILLEGAL  0x0700
38 102 lampret
#define EXCEPT_HPINT    0x0800
39 33 lampret
#define EXCEPT_DTLBMISS 0x0900
40
#define EXCEPT_ITLBMISS 0x0a00
41 102 lampret
#define EXCEPT_RANGE    0x0b00
42 33 lampret
#define EXCEPT_SYSCALL  0x0c00
43
#define EXCEPT_BREAK    0x0d00
44 137 chris
#define EXCEPT_TRAP     0x0e00
45 33 lampret
 
46 261 markom
/* Non maskable exceptions */
47
#define IS_NME(E) ((E) == EXCEPT_RESET)
48
 
49 33 lampret
#define EXCEPT_NAME(E) E == EXCEPT_RESET ? "Reset" : \
50
                        E == EXCEPT_BUSERR ? "Bus Error" : \
51
                        E == EXCEPT_DPF ? "Data Page Fault" : \
52
                        E == EXCEPT_IPF ? "Insn Page Fault" : \
53 102 lampret
                        E == EXCEPT_LPINT ? "Low Priority Interrupt" : \
54 33 lampret
                        E == EXCEPT_ALIGN ? "Alignment" : \
55
                        E == EXCEPT_ILLEGAL ? "Illegal instruction" : \
56 102 lampret
                        E == EXCEPT_HPINT ? "High Priority Interrupt" : \
57 33 lampret
                        E == EXCEPT_DTLBMISS ? "Data TLB Miss" : \
58
                        E == EXCEPT_ITLBMISS ? "Insn TLB Miss" : \
59 102 lampret
                        E == EXCEPT_RANGE ? "Range" : \
60 33 lampret
                        E == EXCEPT_SYSCALL ? "System Call" : \
61 137 chris
                        E == EXCEPT_BREAK ? "Break" : \
62
                        E == EXCEPT_TRAP ? "Trap" : "Unknown"
63
 
64 437 simons
extern struct _pending {
65
  int valid;
66
  int type;
67
  unsigned long address;
68
  unsigned long saved;
69
} pending;
70 102 lampret
 
71 437 simons
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.