aboutsummaryrefslogtreecommitdiff
path: root/sim/frv/registers.h
blob: b74e704ed28afdc35cfdb18d48aa2d9ff928d6d8 (plain)
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
/* Register definitions for the FRV simulator
   Copyright (C) 2000-2014 Free Software Foundation, Inc.
   Contributed by Red Hat.

This file is part of the GNU Simulators.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

#ifndef REGISTERS_H
#define REGISTERS_H

#define FRV_MAX_GR  64
#define FRV_MAX_FR  64
#define FRV_MAX_CPR 64
#define FRV_MAX_SPR 4096

/* Register init, reset values and read_only masks.  */
typedef struct
{
  USI init_value;     /* initial value */
  USI reset_value;    /* value for software reset */
  USI reset_mask;     /* bits which are reset */
  USI read_only_mask; /* bits which are read-only */
  char implemented;   /* 1==register is implemented */
  char supervisor;    /* 1==register is supervisor-only */
} FRV_SPR_CONTROL_INFO;

typedef struct
{
  int fr;                    /* FR registers implemented */
  int cpr;                   /* coprocessor registers implemented */
  FRV_SPR_CONTROL_INFO *spr; /* SPR implementation details */
} FRV_REGISTER_CONTROL;

void frv_register_control_init (SIM_CPU *);
void frv_initialize_spr (SIM_CPU *);
void frv_reset_spr (SIM_CPU *);

void frv_check_spr_access (SIM_CPU *, UINT);

void frv_fr_registers_available (SIM_CPU *, int *, int *);
void frv_gr_registers_available (SIM_CPU *, int *, int *);
int  frv_check_register_access (SIM_CPU *, SI, int, int);
int  frv_check_gr_access (SIM_CPU *, SI);
int  frv_check_fr_access (SIM_CPU *, SI);

#endif /* REGISTERS_H */