1 /* Constants describing types of memory accesses.
2    Copyright 2001, 2003 Brian R. Gaeke.
3 
4 This file is part of VMIPS.
5 
6 VMIPS is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2 of the License, or (at your
9 option) any later version.
10 
11 VMIPS is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 for more details.
15 
16 You should have received a copy of the GNU General Public License along
17 with VMIPS; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
19 
20 #ifndef _ACCESSTYPES_H_
21 #define _ACCESSTYPES_H_
22 
23 /* Three kinds of memory accesses are possible.
24  * There are two kinds of load and one kind of store:
25  * INSTFETCH is a memory access due to an instruction fetch.
26  * DATALOAD is a memory access due to a load instruction,
27  * e.g., lw, lh, lb.
28  * DATASTORE is a memory access due to a store instruction,
29  * e.g., sw, sh, sb.
30  *
31  * ANY is a catch-all used in exception prioritizing which
32  * implies that none of the kinds of memory accesses applies,
33  * or that the type of memory access otherwise doesn't matter.
34  */
35 #define INSTFETCH 0
36 #define DATALOAD 1
37 #define DATASTORE 2
38 #define ANY 3
39 
40 /* add_core_mapping and friends maintain a set of protection
41  * bits which define allowable access to memory. These do
42  * not have anything to do with the virtual memory privilege
43  * bits that a kernel would maintain; they are used to
44  * distinguish between, for example, ROM and RAM, and between
45  * readable and unreadable words of a memory-mapped device.
46  */
47 #define MEM_READ       0x01
48 #define MEM_WRITE      0x02
49 #define MEM_READ_WRITE 0x03
50 
51 #endif /* _ACCESSTYPES_H_ */
52