aboutsummaryrefslogtreecommitdiff
path: root/sim/i960/arch.c
blob: 5d3ab8462099f1dfdb8ee3d991b4fd957e99b727 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
/* Simulator support for i960.

THIS FILE IS MACHINE GENERATED WITH CGEN.

Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.

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 2, 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, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

*/

#include "sim-main.h"
#include "bfd.h"

const MACH *sim_machs[] =
{
#ifdef HAVE_CPU_I960BASE
  & i960_ka_sa_mach,
#endif
#ifdef HAVE_CPU_I960BASE
  & i960_ca_mach,
#endif
  0
};

/* Get the value of h-pc.  */

USI
a_i960_h_pc_get (SIM_CPU *current_cpu)
{
  switch (STATE_ARCHITECTURE (CPU_STATE (current_cpu))->mach)
    {
#ifdef HAVE_CPU_I960BASE
    case bfd_mach_i960_ka_sa : 
      return i960base_h_pc_get (current_cpu);
#endif
#ifdef HAVE_CPU_I960BASE
    case bfd_mach_i960_ca : 
      return i960base_h_pc_get (current_cpu);
#endif
    default :
      abort ();
    }
}

/* Set a value for h-pc.  */

void
a_i960_h_pc_set (SIM_CPU *current_cpu, USI newval)
{
  switch (STATE_ARCHITECTURE (CPU_STATE (current_cpu))->mach)
    {
#ifdef HAVE_CPU_I960BASE
    case bfd_mach_i960_ka_sa : 
      i960base_h_pc_set (current_cpu, newval);
      break;
#endif
#ifdef HAVE_CPU_I960BASE
    case bfd_mach_i960_ca : 
      i960base_h_pc_set (current_cpu, newval);
      break;
#endif
    default :
      abort ();
    }
}

/* Get the value of h-gr.  */

SI
a_i960_h_gr_get (SIM_CPU *current_cpu, UINT regno)
{
  switch (STATE_ARCHITECTURE (CPU_STATE (current_cpu))->mach)
    {
#ifdef HAVE_CPU_I960BASE
    case bfd_mach_i960_ka_sa : 
      return i960base_h_gr_get (current_cpu, regno);
#endif
#ifdef HAVE_CPU_I960BASE
    case bfd_mach_i960_ca : 
      return i960base_h_gr_get (current_cpu, regno);
#endif
    default :
      abort ();
    }
}

/* Set a value for h-gr.  */

void
a_i960_h_gr_set (SIM_CPU *current_cpu, UINT regno, SI newval)
{
  switch (STATE_ARCHITECTURE (CPU_STATE (current_cpu))->mach)
    {
#ifdef HAVE_CPU_I960BASE
    case bfd_mach_i960_ka_sa : 
      i960base_h_gr_set (current_cpu, regno, newval);
      break;
#endif
#ifdef HAVE_CPU_I960BASE
    case bfd_mach_i960_ca : 
      i960base_h_gr_set (current_cpu, regno, newval);
      break;
#endif
    default :
      abort ();
    }
}

/* Get the value of h-cc.  */

SI
a_i960_h_cc_get (SIM_CPU *current_cpu)
{
  switch (STATE_ARCHITECTURE (CPU_STATE (current_cpu))->mach)
    {
#ifdef HAVE_CPU_I960BASE
    case bfd_mach_i960_ka_sa : 
      return i960base_h_cc_get (current_cpu);
#endif
#ifdef HAVE_CPU_I960BASE
    case bfd_mach_i960_ca : 
      return i960base_h_cc_get (current_cpu);
#endif
    default :
      abort ();
    }
}

/* Set a value for h-cc.  */

void
a_i960_h_cc_set (SIM_CPU *current_cpu, SI newval)
{
  switch (STATE_ARCHITECTURE (CPU_STATE (current_cpu))->mach)
    {
#ifdef HAVE_CPU_I960BASE
    case bfd_mach_i960_ka_sa : 
      i960base_h_cc_set (current_cpu, newval);
      break;
#endif
#ifdef HAVE_CPU_I960BASE
    case bfd_mach_i960_ca : 
      i960base_h_cc_set (current_cpu, newval);
      break;
#endif
    default :
      abort ();
    }
}