Commit | Line | Data |
---|---|---|
c906108c SS |
1 | /* Simulator support for i960. |
2 | ||
3 | THIS FILE IS MACHINE GENERATED WITH CGEN. | |
4 | ||
5 | Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. | |
6 | ||
7 | This file is part of the GNU Simulators. | |
8 | ||
9 | This program is free software; you can redistribute it and/or modify | |
10 | it under the terms of the GNU General Public License as published by | |
11 | the Free Software Foundation; either version 2, or (at your option) | |
12 | any later version. | |
13 | ||
14 | This program is distributed in the hope that it will be useful, | |
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | GNU General Public License for more details. | |
18 | ||
19 | You should have received a copy of the GNU General Public License along | |
20 | with this program; if not, write to the Free Software Foundation, Inc., | |
21 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
22 | ||
23 | */ | |
24 | ||
25 | #include "sim-main.h" | |
26 | #include "bfd.h" | |
27 | ||
28 | const 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 | ||
41 | USI | |
42 | a_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 | ||
61 | void | |
62 | a_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 | ||
83 | SI | |
84 | a_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 | ||
103 | void | |
104 | a_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 | ||
125 | SI | |
126 | a_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 | ||
145 | void | |
146 | a_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 |