Commit | Line | Data |
---|---|---|
b34f6357 | 1 | /* Register definitions for the FRV simulator |
7b6bb8da JB |
2 | Copyright (C) 2000, 2007, 2008, 2009, 2010, 2011 |
3 | Free Software Foundation, Inc. | |
b34f6357 DB |
4 | Contributed by Red Hat. |
5 | ||
6 | This file is part of the GNU Simulators. | |
7 | ||
8 | This program is free software; you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
4744ac1b JB |
10 | the Free Software Foundation; either version 3 of the License, or |
11 | (at your option) any later version. | |
b34f6357 DB |
12 | |
13 | This program is distributed in the hope that it will be useful, | |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
4744ac1b JB |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
b34f6357 DB |
20 | |
21 | #ifndef REGISTERS_H | |
22 | #define REGISTERS_H | |
23 | ||
24 | #define FRV_MAX_GR 64 | |
25 | #define FRV_MAX_FR 64 | |
26 | #define FRV_MAX_CPR 64 | |
27 | #define FRV_MAX_SPR 4096 | |
28 | ||
29 | /* Register init, reset values and read_only masks. */ | |
30 | typedef struct | |
31 | { | |
32 | USI init_value; /* initial value */ | |
33 | USI reset_value; /* value for software reset */ | |
34 | USI reset_mask; /* bits which are reset */ | |
35 | USI read_only_mask; /* bits which are read-only */ | |
36 | char implemented; /* 1==register is implemented */ | |
37 | char supervisor; /* 1==register is supervisor-only */ | |
38 | } FRV_SPR_CONTROL_INFO; | |
39 | ||
40 | typedef struct | |
41 | { | |
42 | int fr; /* FR registers implemented */ | |
43 | int cpr; /* coprocessor registers implemented */ | |
44 | FRV_SPR_CONTROL_INFO *spr; /* SPR implementation details */ | |
45 | } FRV_REGISTER_CONTROL; | |
46 | ||
47 | void frv_register_control_init (SIM_CPU *); | |
48 | void frv_initialize_spr (SIM_CPU *); | |
49 | void frv_reset_spr (SIM_CPU *); | |
50 | ||
51 | void frv_check_spr_access (SIM_CPU *, UINT); | |
52 | ||
53 | void frv_fr_registers_available (SIM_CPU *, int *, int *); | |
54 | void frv_gr_registers_available (SIM_CPU *, int *, int *); | |
55 | int frv_check_register_access (SIM_CPU *, SI, int, int); | |
56 | int frv_check_gr_access (SIM_CPU *, SI); | |
57 | int frv_check_fr_access (SIM_CPU *, SI); | |
58 | ||
59 | #endif /* REGISTERS_H */ |