Initial creation of sourceware repository
[deliverable/binutils-gdb.git] / sim / i960 / arch.c
CommitLineData
c906108c
SS
1/* Simulator support for i960.
2
3THIS FILE IS MACHINE GENERATED WITH CGEN.
4
5Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
6
7This file is part of the GNU Simulators.
8
9This program is free software; you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation; either version 2, or (at your option)
12any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License along
20with this program; if not, write to the Free Software Foundation, Inc.,
2159 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23*/
24
25#include "sim-main.h"
26#include "bfd.h"
27
28const MACH *sim_machs[] =
29{
30#ifdef HAVE_CPU_I960BASE
31 & i960_ka_sa_mach,
32#endif
33#ifdef HAVE_CPU_I960BASE
34 & i960_ca_mach,
35#endif
36 0
37};
38
39/* Get the value of h-pc. */
40
41USI
42a_i960_h_pc_get (SIM_CPU *current_cpu)
43{
44 switch (STATE_ARCHITECTURE (CPU_STATE (current_cpu))->mach)
45 {
46#ifdef HAVE_CPU_I960BASE
47 case bfd_mach_i960_ka_sa :
48 return i960base_h_pc_get (current_cpu);
49#endif
50#ifdef HAVE_CPU_I960BASE
51 case bfd_mach_i960_ca :
52 return i960base_h_pc_get (current_cpu);
53#endif
54 default :
55 abort ();
56 }
57}
58
59/* Set a value for h-pc. */
60
61void
62a_i960_h_pc_set (SIM_CPU *current_cpu, USI newval)
63{
64 switch (STATE_ARCHITECTURE (CPU_STATE (current_cpu))->mach)
65 {
66#ifdef HAVE_CPU_I960BASE
67 case bfd_mach_i960_ka_sa :
68 i960base_h_pc_set (current_cpu, newval);
69 break;
70#endif
71#ifdef HAVE_CPU_I960BASE
72 case bfd_mach_i960_ca :
73 i960base_h_pc_set (current_cpu, newval);
74 break;
75#endif
76 default :
77 abort ();
78 }
79}
80
81/* Get the value of h-gr. */
82
83SI
84a_i960_h_gr_get (SIM_CPU *current_cpu, UINT regno)
85{
86 switch (STATE_ARCHITECTURE (CPU_STATE (current_cpu))->mach)
87 {
88#ifdef HAVE_CPU_I960BASE
89 case bfd_mach_i960_ka_sa :
90 return i960base_h_gr_get (current_cpu, regno);
91#endif
92#ifdef HAVE_CPU_I960BASE
93 case bfd_mach_i960_ca :
94 return i960base_h_gr_get (current_cpu, regno);
95#endif
96 default :
97 abort ();
98 }
99}
100
101/* Set a value for h-gr. */
102
103void
104a_i960_h_gr_set (SIM_CPU *current_cpu, UINT regno, SI newval)
105{
106 switch (STATE_ARCHITECTURE (CPU_STATE (current_cpu))->mach)
107 {
108#ifdef HAVE_CPU_I960BASE
109 case bfd_mach_i960_ka_sa :
110 i960base_h_gr_set (current_cpu, regno, newval);
111 break;
112#endif
113#ifdef HAVE_CPU_I960BASE
114 case bfd_mach_i960_ca :
115 i960base_h_gr_set (current_cpu, regno, newval);
116 break;
117#endif
118 default :
119 abort ();
120 }
121}
122
123/* Get the value of h-cc. */
124
125SI
126a_i960_h_cc_get (SIM_CPU *current_cpu)
127{
128 switch (STATE_ARCHITECTURE (CPU_STATE (current_cpu))->mach)
129 {
130#ifdef HAVE_CPU_I960BASE
131 case bfd_mach_i960_ka_sa :
132 return i960base_h_cc_get (current_cpu);
133#endif
134#ifdef HAVE_CPU_I960BASE
135 case bfd_mach_i960_ca :
136 return i960base_h_cc_get (current_cpu);
137#endif
138 default :
139 abort ();
140 }
141}
142
143/* Set a value for h-cc. */
144
145void
146a_i960_h_cc_set (SIM_CPU *current_cpu, SI newval)
147{
148 switch (STATE_ARCHITECTURE (CPU_STATE (current_cpu))->mach)
149 {
150#ifdef HAVE_CPU_I960BASE
151 case bfd_mach_i960_ka_sa :
152 i960base_h_cc_set (current_cpu, newval);
153 break;
154#endif
155#ifdef HAVE_CPU_I960BASE
156 case bfd_mach_i960_ca :
157 i960base_h_cc_set (current_cpu, newval);
158 break;
159#endif
160 default :
161 abort ();
162 }
163}
164
This page took 0.032353 seconds and 4 git commands to generate.