Statistics
| Branch: | Revision:

root / target-ppc / translate_init.c @ d7e4b87e

History | View | Annotate | Download (234 kB)

1 3fc6c082 bellard
/*
2 3fc6c082 bellard
 *  PowerPC CPU initialization for qemu.
3 5fafdf24 ths
 *
4 76a66253 j_mayer
 *  Copyright (c) 2003-2007 Jocelyn Mayer
5 3fc6c082 bellard
 *
6 3fc6c082 bellard
 * This library is free software; you can redistribute it and/or
7 3fc6c082 bellard
 * modify it under the terms of the GNU Lesser General Public
8 3fc6c082 bellard
 * License as published by the Free Software Foundation; either
9 3fc6c082 bellard
 * version 2 of the License, or (at your option) any later version.
10 3fc6c082 bellard
 *
11 3fc6c082 bellard
 * This library is distributed in the hope that it will be useful,
12 3fc6c082 bellard
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 3fc6c082 bellard
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 3fc6c082 bellard
 * Lesser General Public License for more details.
15 3fc6c082 bellard
 *
16 3fc6c082 bellard
 * You should have received a copy of the GNU Lesser General Public
17 3fc6c082 bellard
 * License along with this library; if not, write to the Free Software
18 3fc6c082 bellard
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 3fc6c082 bellard
 */
20 3fc6c082 bellard
21 3fc6c082 bellard
/* A lot of PowerPC definition have been included here.
22 3fc6c082 bellard
 * Most of them are not usable for now but have been kept
23 3fc6c082 bellard
 * inside "#if defined(TODO) ... #endif" statements to make tests easier.
24 3fc6c082 bellard
 */
25 3fc6c082 bellard
26 237c0af0 j_mayer
#include "dis-asm.h"
27 237c0af0 j_mayer
28 3fc6c082 bellard
//#define PPC_DUMP_CPU
29 3fc6c082 bellard
//#define PPC_DEBUG_SPR
30 a496775f j_mayer
//#define PPC_DEBUG_IRQ
31 3fc6c082 bellard
32 3fc6c082 bellard
struct ppc_def_t {
33 3fc6c082 bellard
    const unsigned char *name;
34 3fc6c082 bellard
    uint32_t pvr;
35 3fc6c082 bellard
    uint32_t pvr_mask;
36 0487d6a8 j_mayer
    uint64_t insns_flags;
37 3fc6c082 bellard
    uint64_t msr_mask;
38 a750fc0b j_mayer
    uint8_t mmu_model;
39 a750fc0b j_mayer
    uint8_t excp_model;
40 a750fc0b j_mayer
    uint8_t bus_model;
41 a750fc0b j_mayer
    uint8_t pad;
42 237c0af0 j_mayer
    int bfd_mach;
43 a750fc0b j_mayer
    void (*init_proc)(CPUPPCState *env);
44 3fc6c082 bellard
};
45 3fc6c082 bellard
46 e9df014c j_mayer
/* For user-mode emulation, we don't emulate any IRQ controller */
47 e9df014c j_mayer
#if defined(CONFIG_USER_ONLY)
48 a750fc0b j_mayer
#define PPC_IRQ_INIT_FN(name)                                                 \
49 a750fc0b j_mayer
static inline void glue(glue(ppc, name),_irq_init) (CPUPPCState *env)         \
50 a750fc0b j_mayer
{                                                                             \
51 e9df014c j_mayer
}
52 e9df014c j_mayer
#else
53 a750fc0b j_mayer
#define PPC_IRQ_INIT_FN(name)                                                 \
54 e9df014c j_mayer
void glue(glue(ppc, name),_irq_init) (CPUPPCState *env);
55 e9df014c j_mayer
#endif
56 a750fc0b j_mayer
57 a750fc0b j_mayer
PPC_IRQ_INIT_FN(401);
58 24be5ae3 j_mayer
PPC_IRQ_INIT_FN(405);
59 e9df014c j_mayer
PPC_IRQ_INIT_FN(6xx);
60 d0dfae6e j_mayer
PPC_IRQ_INIT_FN(970);
61 e9df014c j_mayer
62 3fc6c082 bellard
/* Generic callbacks:
63 3fc6c082 bellard
 * do nothing but store/retrieve spr value
64 3fc6c082 bellard
 */
65 04f20795 j_mayer
#ifdef PPC_DUMP_SPR_ACCESSES
66 3fc6c082 bellard
static void spr_read_generic (void *opaque, int sprn)
67 3fc6c082 bellard
{
68 04f20795 j_mayer
    gen_op_load_dump_spr(sprn);
69 3fc6c082 bellard
}
70 3fc6c082 bellard
71 3fc6c082 bellard
static void spr_write_generic (void *opaque, int sprn)
72 3fc6c082 bellard
{
73 04f20795 j_mayer
    gen_op_store_dump_spr(sprn);
74 3fc6c082 bellard
}
75 04f20795 j_mayer
#else
76 04f20795 j_mayer
static void spr_read_generic (void *opaque, int sprn)
77 a496775f j_mayer
{
78 04f20795 j_mayer
    gen_op_load_spr(sprn);
79 a496775f j_mayer
}
80 a496775f j_mayer
81 04f20795 j_mayer
static void spr_write_generic (void *opaque, int sprn)
82 a496775f j_mayer
{
83 04f20795 j_mayer
    gen_op_store_spr(sprn);
84 a496775f j_mayer
}
85 04f20795 j_mayer
#endif
86 a496775f j_mayer
87 a496775f j_mayer
#if !defined(CONFIG_USER_ONLY)
88 a496775f j_mayer
static void spr_write_clear (void *opaque, int sprn)
89 a496775f j_mayer
{
90 a496775f j_mayer
    gen_op_mask_spr(sprn);
91 a496775f j_mayer
}
92 a496775f j_mayer
#endif
93 a496775f j_mayer
94 76a66253 j_mayer
/* SPR common to all PowerPC */
95 3fc6c082 bellard
/* XER */
96 3fc6c082 bellard
static void spr_read_xer (void *opaque, int sprn)
97 3fc6c082 bellard
{
98 3fc6c082 bellard
    gen_op_load_xer();
99 3fc6c082 bellard
}
100 3fc6c082 bellard
101 3fc6c082 bellard
static void spr_write_xer (void *opaque, int sprn)
102 3fc6c082 bellard
{
103 3fc6c082 bellard
    gen_op_store_xer();
104 3fc6c082 bellard
}
105 3fc6c082 bellard
106 3fc6c082 bellard
/* LR */
107 3fc6c082 bellard
static void spr_read_lr (void *opaque, int sprn)
108 3fc6c082 bellard
{
109 3fc6c082 bellard
    gen_op_load_lr();
110 3fc6c082 bellard
}
111 3fc6c082 bellard
112 3fc6c082 bellard
static void spr_write_lr (void *opaque, int sprn)
113 3fc6c082 bellard
{
114 3fc6c082 bellard
    gen_op_store_lr();
115 3fc6c082 bellard
}
116 3fc6c082 bellard
117 3fc6c082 bellard
/* CTR */
118 3fc6c082 bellard
static void spr_read_ctr (void *opaque, int sprn)
119 3fc6c082 bellard
{
120 3fc6c082 bellard
    gen_op_load_ctr();
121 3fc6c082 bellard
}
122 3fc6c082 bellard
123 3fc6c082 bellard
static void spr_write_ctr (void *opaque, int sprn)
124 3fc6c082 bellard
{
125 3fc6c082 bellard
    gen_op_store_ctr();
126 3fc6c082 bellard
}
127 3fc6c082 bellard
128 3fc6c082 bellard
/* User read access to SPR */
129 3fc6c082 bellard
/* USPRx */
130 3fc6c082 bellard
/* UMMCRx */
131 3fc6c082 bellard
/* UPMCx */
132 3fc6c082 bellard
/* USIA */
133 3fc6c082 bellard
/* UDECR */
134 3fc6c082 bellard
static void spr_read_ureg (void *opaque, int sprn)
135 3fc6c082 bellard
{
136 3fc6c082 bellard
    gen_op_load_spr(sprn + 0x10);
137 3fc6c082 bellard
}
138 3fc6c082 bellard
139 76a66253 j_mayer
/* SPR common to all non-embedded PowerPC */
140 3fc6c082 bellard
/* DECR */
141 76a66253 j_mayer
#if !defined(CONFIG_USER_ONLY)
142 3fc6c082 bellard
static void spr_read_decr (void *opaque, int sprn)
143 3fc6c082 bellard
{
144 3fc6c082 bellard
    gen_op_load_decr();
145 3fc6c082 bellard
}
146 3fc6c082 bellard
147 3fc6c082 bellard
static void spr_write_decr (void *opaque, int sprn)
148 3fc6c082 bellard
{
149 3fc6c082 bellard
    gen_op_store_decr();
150 3fc6c082 bellard
}
151 76a66253 j_mayer
#endif
152 3fc6c082 bellard
153 76a66253 j_mayer
/* SPR common to all non-embedded PowerPC, except 601 */
154 3fc6c082 bellard
/* Time base */
155 3fc6c082 bellard
static void spr_read_tbl (void *opaque, int sprn)
156 3fc6c082 bellard
{
157 3fc6c082 bellard
    gen_op_load_tbl();
158 3fc6c082 bellard
}
159 3fc6c082 bellard
160 76a66253 j_mayer
static void spr_read_tbu (void *opaque, int sprn)
161 3fc6c082 bellard
{
162 76a66253 j_mayer
    gen_op_load_tbu();
163 3fc6c082 bellard
}
164 3fc6c082 bellard
165 a062e36c j_mayer
__attribute__ (( unused ))
166 a062e36c j_mayer
static void spr_read_atbl (void *opaque, int sprn)
167 a062e36c j_mayer
{
168 a062e36c j_mayer
    gen_op_load_atbl();
169 a062e36c j_mayer
}
170 a062e36c j_mayer
171 a062e36c j_mayer
__attribute__ (( unused ))
172 a062e36c j_mayer
static void spr_read_atbu (void *opaque, int sprn)
173 a062e36c j_mayer
{
174 a062e36c j_mayer
    gen_op_load_atbu();
175 a062e36c j_mayer
}
176 a062e36c j_mayer
177 76a66253 j_mayer
#if !defined(CONFIG_USER_ONLY)
178 76a66253 j_mayer
static void spr_write_tbl (void *opaque, int sprn)
179 3fc6c082 bellard
{
180 76a66253 j_mayer
    gen_op_store_tbl();
181 3fc6c082 bellard
}
182 3fc6c082 bellard
183 3fc6c082 bellard
static void spr_write_tbu (void *opaque, int sprn)
184 3fc6c082 bellard
{
185 3fc6c082 bellard
    gen_op_store_tbu();
186 3fc6c082 bellard
}
187 a062e36c j_mayer
188 a062e36c j_mayer
__attribute__ (( unused ))
189 a062e36c j_mayer
static void spr_write_atbl (void *opaque, int sprn)
190 a062e36c j_mayer
{
191 a062e36c j_mayer
    gen_op_store_atbl();
192 a062e36c j_mayer
}
193 a062e36c j_mayer
194 a062e36c j_mayer
__attribute__ (( unused ))
195 a062e36c j_mayer
static void spr_write_atbu (void *opaque, int sprn)
196 a062e36c j_mayer
{
197 a062e36c j_mayer
    gen_op_store_atbu();
198 a062e36c j_mayer
}
199 76a66253 j_mayer
#endif
200 3fc6c082 bellard
201 76a66253 j_mayer
#if !defined(CONFIG_USER_ONLY)
202 3fc6c082 bellard
/* IBAT0U...IBAT0U */
203 3fc6c082 bellard
/* IBAT0L...IBAT7L */
204 3fc6c082 bellard
static void spr_read_ibat (void *opaque, int sprn)
205 3fc6c082 bellard
{
206 3fc6c082 bellard
    gen_op_load_ibat(sprn & 1, (sprn - SPR_IBAT0U) / 2);
207 3fc6c082 bellard
}
208 3fc6c082 bellard
209 3fc6c082 bellard
static void spr_read_ibat_h (void *opaque, int sprn)
210 3fc6c082 bellard
{
211 3fc6c082 bellard
    gen_op_load_ibat(sprn & 1, (sprn - SPR_IBAT4U) / 2);
212 3fc6c082 bellard
}
213 3fc6c082 bellard
214 3fc6c082 bellard
static void spr_write_ibatu (void *opaque, int sprn)
215 3fc6c082 bellard
{
216 3fc6c082 bellard
    gen_op_store_ibatu((sprn - SPR_IBAT0U) / 2);
217 3fc6c082 bellard
}
218 3fc6c082 bellard
219 3fc6c082 bellard
static void spr_write_ibatu_h (void *opaque, int sprn)
220 3fc6c082 bellard
{
221 3fc6c082 bellard
    gen_op_store_ibatu((sprn - SPR_IBAT4U) / 2);
222 3fc6c082 bellard
}
223 3fc6c082 bellard
224 3fc6c082 bellard
static void spr_write_ibatl (void *opaque, int sprn)
225 3fc6c082 bellard
{
226 3fc6c082 bellard
    gen_op_store_ibatl((sprn - SPR_IBAT0L) / 2);
227 3fc6c082 bellard
}
228 3fc6c082 bellard
229 3fc6c082 bellard
static void spr_write_ibatl_h (void *opaque, int sprn)
230 3fc6c082 bellard
{
231 3fc6c082 bellard
    gen_op_store_ibatl((sprn - SPR_IBAT4L) / 2);
232 3fc6c082 bellard
}
233 3fc6c082 bellard
234 3fc6c082 bellard
/* DBAT0U...DBAT7U */
235 3fc6c082 bellard
/* DBAT0L...DBAT7L */
236 3fc6c082 bellard
static void spr_read_dbat (void *opaque, int sprn)
237 3fc6c082 bellard
{
238 3fc6c082 bellard
    gen_op_load_dbat(sprn & 1, (sprn - SPR_DBAT0U) / 2);
239 3fc6c082 bellard
}
240 3fc6c082 bellard
241 3fc6c082 bellard
static void spr_read_dbat_h (void *opaque, int sprn)
242 3fc6c082 bellard
{
243 3fc6c082 bellard
    gen_op_load_dbat(sprn & 1, (sprn - SPR_DBAT4U) / 2);
244 3fc6c082 bellard
}
245 3fc6c082 bellard
246 3fc6c082 bellard
static void spr_write_dbatu (void *opaque, int sprn)
247 3fc6c082 bellard
{
248 3fc6c082 bellard
    gen_op_store_dbatu((sprn - SPR_DBAT0U) / 2);
249 3fc6c082 bellard
}
250 3fc6c082 bellard
251 3fc6c082 bellard
static void spr_write_dbatu_h (void *opaque, int sprn)
252 3fc6c082 bellard
{
253 3fc6c082 bellard
    gen_op_store_dbatu((sprn - SPR_DBAT4U) / 2);
254 3fc6c082 bellard
}
255 3fc6c082 bellard
256 3fc6c082 bellard
static void spr_write_dbatl (void *opaque, int sprn)
257 3fc6c082 bellard
{
258 3fc6c082 bellard
    gen_op_store_dbatl((sprn - SPR_DBAT0L) / 2);
259 3fc6c082 bellard
}
260 3fc6c082 bellard
261 3fc6c082 bellard
static void spr_write_dbatl_h (void *opaque, int sprn)
262 3fc6c082 bellard
{
263 3fc6c082 bellard
    gen_op_store_dbatl((sprn - SPR_DBAT4L) / 2);
264 3fc6c082 bellard
}
265 3fc6c082 bellard
266 3fc6c082 bellard
/* SDR1 */
267 3fc6c082 bellard
static void spr_read_sdr1 (void *opaque, int sprn)
268 3fc6c082 bellard
{
269 3fc6c082 bellard
    gen_op_load_sdr1();
270 3fc6c082 bellard
}
271 3fc6c082 bellard
272 3fc6c082 bellard
static void spr_write_sdr1 (void *opaque, int sprn)
273 3fc6c082 bellard
{
274 3fc6c082 bellard
    gen_op_store_sdr1();
275 3fc6c082 bellard
}
276 3fc6c082 bellard
277 76a66253 j_mayer
/* 64 bits PowerPC specific SPRs */
278 76a66253 j_mayer
/* ASR */
279 5b284968 ths
/* Currently unused */
280 5b284968 ths
#if 0 && defined(TARGET_PPC64)
281 76a66253 j_mayer
static void spr_read_asr (void *opaque, int sprn)
282 76a66253 j_mayer
{
283 76a66253 j_mayer
    gen_op_load_asr();
284 76a66253 j_mayer
}
285 76a66253 j_mayer

286 76a66253 j_mayer
static void spr_write_asr (void *opaque, int sprn)
287 76a66253 j_mayer
{
288 76a66253 j_mayer
    DisasContext *ctx = opaque;
289 76a66253 j_mayer

290 76a66253 j_mayer
    gen_op_store_asr();
291 76a66253 j_mayer
}
292 76a66253 j_mayer
#endif
293 a750fc0b j_mayer
#endif
294 76a66253 j_mayer
295 76a66253 j_mayer
/* PowerPC 601 specific registers */
296 76a66253 j_mayer
/* RTC */
297 76a66253 j_mayer
static void spr_read_601_rtcl (void *opaque, int sprn)
298 76a66253 j_mayer
{
299 76a66253 j_mayer
    gen_op_load_601_rtcl();
300 76a66253 j_mayer
}
301 76a66253 j_mayer
302 76a66253 j_mayer
static void spr_read_601_rtcu (void *opaque, int sprn)
303 76a66253 j_mayer
{
304 76a66253 j_mayer
    gen_op_load_601_rtcu();
305 76a66253 j_mayer
}
306 76a66253 j_mayer
307 76a66253 j_mayer
#if !defined(CONFIG_USER_ONLY)
308 76a66253 j_mayer
static void spr_write_601_rtcu (void *opaque, int sprn)
309 76a66253 j_mayer
{
310 76a66253 j_mayer
    gen_op_store_601_rtcu();
311 76a66253 j_mayer
}
312 76a66253 j_mayer
313 76a66253 j_mayer
static void spr_write_601_rtcl (void *opaque, int sprn)
314 76a66253 j_mayer
{
315 76a66253 j_mayer
    gen_op_store_601_rtcl();
316 76a66253 j_mayer
}
317 76a66253 j_mayer
#endif
318 76a66253 j_mayer
319 76a66253 j_mayer
/* Unified bats */
320 76a66253 j_mayer
#if !defined(CONFIG_USER_ONLY)
321 76a66253 j_mayer
static void spr_read_601_ubat (void *opaque, int sprn)
322 76a66253 j_mayer
{
323 76a66253 j_mayer
    gen_op_load_601_bat(sprn & 1, (sprn - SPR_IBAT0U) / 2);
324 76a66253 j_mayer
}
325 76a66253 j_mayer
326 76a66253 j_mayer
static void spr_write_601_ubatu (void *opaque, int sprn)
327 76a66253 j_mayer
{
328 76a66253 j_mayer
    gen_op_store_601_batu((sprn - SPR_IBAT0U) / 2);
329 76a66253 j_mayer
}
330 76a66253 j_mayer
331 76a66253 j_mayer
static void spr_write_601_ubatl (void *opaque, int sprn)
332 76a66253 j_mayer
{
333 76a66253 j_mayer
    gen_op_store_601_batl((sprn - SPR_IBAT0L) / 2);
334 76a66253 j_mayer
}
335 76a66253 j_mayer
#endif
336 76a66253 j_mayer
337 76a66253 j_mayer
/* PowerPC 40x specific registers */
338 76a66253 j_mayer
#if !defined(CONFIG_USER_ONLY)
339 76a66253 j_mayer
static void spr_read_40x_pit (void *opaque, int sprn)
340 76a66253 j_mayer
{
341 76a66253 j_mayer
    gen_op_load_40x_pit();
342 76a66253 j_mayer
}
343 76a66253 j_mayer
344 76a66253 j_mayer
static void spr_write_40x_pit (void *opaque, int sprn)
345 76a66253 j_mayer
{
346 76a66253 j_mayer
    gen_op_store_40x_pit();
347 76a66253 j_mayer
}
348 76a66253 j_mayer
349 8ecc7913 j_mayer
static void spr_write_40x_dbcr0 (void *opaque, int sprn)
350 8ecc7913 j_mayer
{
351 8ecc7913 j_mayer
    DisasContext *ctx = opaque;
352 8ecc7913 j_mayer
353 8ecc7913 j_mayer
    gen_op_store_40x_dbcr0();
354 8ecc7913 j_mayer
    /* We must stop translation as we may have rebooted */
355 e1833e1f j_mayer
    GEN_STOP(ctx);
356 8ecc7913 j_mayer
}
357 8ecc7913 j_mayer
358 c294fc58 j_mayer
static void spr_write_40x_sler (void *opaque, int sprn)
359 c294fc58 j_mayer
{
360 c294fc58 j_mayer
    gen_op_store_40x_sler();
361 c294fc58 j_mayer
}
362 c294fc58 j_mayer
363 76a66253 j_mayer
static void spr_write_booke_tcr (void *opaque, int sprn)
364 76a66253 j_mayer
{
365 76a66253 j_mayer
    gen_op_store_booke_tcr();
366 76a66253 j_mayer
}
367 76a66253 j_mayer
368 76a66253 j_mayer
static void spr_write_booke_tsr (void *opaque, int sprn)
369 76a66253 j_mayer
{
370 76a66253 j_mayer
    gen_op_store_booke_tsr();
371 76a66253 j_mayer
}
372 76a66253 j_mayer
#endif
373 76a66253 j_mayer
374 76a66253 j_mayer
/* PowerPC 403 specific registers */
375 76a66253 j_mayer
/* PBL1 / PBU1 / PBL2 / PBU2 */
376 76a66253 j_mayer
#if !defined(CONFIG_USER_ONLY)
377 76a66253 j_mayer
static void spr_read_403_pbr (void *opaque, int sprn)
378 76a66253 j_mayer
{
379 76a66253 j_mayer
    gen_op_load_403_pb(sprn - SPR_403_PBL1);
380 76a66253 j_mayer
}
381 76a66253 j_mayer
382 76a66253 j_mayer
static void spr_write_403_pbr (void *opaque, int sprn)
383 76a66253 j_mayer
{
384 76a66253 j_mayer
    gen_op_store_403_pb(sprn - SPR_403_PBL1);
385 76a66253 j_mayer
}
386 76a66253 j_mayer
387 3fc6c082 bellard
static void spr_write_pir (void *opaque, int sprn)
388 3fc6c082 bellard
{
389 3fc6c082 bellard
    gen_op_store_pir();
390 3fc6c082 bellard
}
391 76a66253 j_mayer
#endif
392 3fc6c082 bellard
393 76a66253 j_mayer
#if defined(CONFIG_USER_ONLY)
394 76a66253 j_mayer
#define spr_register(env, num, name, uea_read, uea_write,                     \
395 76a66253 j_mayer
                     oea_read, oea_write, initial_value)                      \
396 76a66253 j_mayer
do {                                                                          \
397 76a66253 j_mayer
     _spr_register(env, num, name, uea_read, uea_write, initial_value);       \
398 76a66253 j_mayer
} while (0)
399 76a66253 j_mayer
static inline void _spr_register (CPUPPCState *env, int num,
400 76a66253 j_mayer
                                  const unsigned char *name,
401 76a66253 j_mayer
                                  void (*uea_read)(void *opaque, int sprn),
402 76a66253 j_mayer
                                  void (*uea_write)(void *opaque, int sprn),
403 76a66253 j_mayer
                                  target_ulong initial_value)
404 76a66253 j_mayer
#else
405 3fc6c082 bellard
static inline void spr_register (CPUPPCState *env, int num,
406 3fc6c082 bellard
                                 const unsigned char *name,
407 3fc6c082 bellard
                                 void (*uea_read)(void *opaque, int sprn),
408 3fc6c082 bellard
                                 void (*uea_write)(void *opaque, int sprn),
409 3fc6c082 bellard
                                 void (*oea_read)(void *opaque, int sprn),
410 3fc6c082 bellard
                                 void (*oea_write)(void *opaque, int sprn),
411 3fc6c082 bellard
                                 target_ulong initial_value)
412 76a66253 j_mayer
#endif
413 3fc6c082 bellard
{
414 3fc6c082 bellard
    ppc_spr_t *spr;
415 3fc6c082 bellard
416 3fc6c082 bellard
    spr = &env->spr_cb[num];
417 3fc6c082 bellard
    if (spr->name != NULL ||env-> spr[num] != 0x00000000 ||
418 76a66253 j_mayer
#if !defined(CONFIG_USER_ONLY)
419 76a66253 j_mayer
        spr->oea_read != NULL || spr->oea_write != NULL ||
420 76a66253 j_mayer
#endif
421 76a66253 j_mayer
        spr->uea_read != NULL || spr->uea_write != NULL) {
422 3fc6c082 bellard
        printf("Error: Trying to register SPR %d (%03x) twice !\n", num, num);
423 3fc6c082 bellard
        exit(1);
424 3fc6c082 bellard
    }
425 3fc6c082 bellard
#if defined(PPC_DEBUG_SPR)
426 1b9eb036 j_mayer
    printf("*** register spr %d (%03x) %s val " ADDRX "\n", num, num, name,
427 76a66253 j_mayer
           initial_value);
428 3fc6c082 bellard
#endif
429 3fc6c082 bellard
    spr->name = name;
430 3fc6c082 bellard
    spr->uea_read = uea_read;
431 3fc6c082 bellard
    spr->uea_write = uea_write;
432 76a66253 j_mayer
#if !defined(CONFIG_USER_ONLY)
433 3fc6c082 bellard
    spr->oea_read = oea_read;
434 3fc6c082 bellard
    spr->oea_write = oea_write;
435 76a66253 j_mayer
#endif
436 3fc6c082 bellard
    env->spr[num] = initial_value;
437 3fc6c082 bellard
}
438 3fc6c082 bellard
439 3fc6c082 bellard
/* Generic PowerPC SPRs */
440 3fc6c082 bellard
static void gen_spr_generic (CPUPPCState *env)
441 3fc6c082 bellard
{
442 3fc6c082 bellard
    /* Integer processing */
443 3fc6c082 bellard
    spr_register(env, SPR_XER, "XER",
444 3fc6c082 bellard
                 &spr_read_xer, &spr_write_xer,
445 3fc6c082 bellard
                 &spr_read_xer, &spr_write_xer,
446 3fc6c082 bellard
                 0x00000000);
447 3fc6c082 bellard
    /* Branch contol */
448 3fc6c082 bellard
    spr_register(env, SPR_LR, "LR",
449 3fc6c082 bellard
                 &spr_read_lr, &spr_write_lr,
450 3fc6c082 bellard
                 &spr_read_lr, &spr_write_lr,
451 3fc6c082 bellard
                 0x00000000);
452 3fc6c082 bellard
    spr_register(env, SPR_CTR, "CTR",
453 3fc6c082 bellard
                 &spr_read_ctr, &spr_write_ctr,
454 3fc6c082 bellard
                 &spr_read_ctr, &spr_write_ctr,
455 3fc6c082 bellard
                 0x00000000);
456 3fc6c082 bellard
    /* Interrupt processing */
457 3fc6c082 bellard
    spr_register(env, SPR_SRR0, "SRR0",
458 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
459 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
460 3fc6c082 bellard
                 0x00000000);
461 3fc6c082 bellard
    spr_register(env, SPR_SRR1, "SRR1",
462 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
463 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
464 3fc6c082 bellard
                 0x00000000);
465 3fc6c082 bellard
    /* Processor control */
466 3fc6c082 bellard
    spr_register(env, SPR_SPRG0, "SPRG0",
467 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
468 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
469 3fc6c082 bellard
                 0x00000000);
470 3fc6c082 bellard
    spr_register(env, SPR_SPRG1, "SPRG1",
471 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
472 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
473 3fc6c082 bellard
                 0x00000000);
474 3fc6c082 bellard
    spr_register(env, SPR_SPRG2, "SPRG2",
475 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
476 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
477 3fc6c082 bellard
                 0x00000000);
478 3fc6c082 bellard
    spr_register(env, SPR_SPRG3, "SPRG3",
479 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
480 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
481 3fc6c082 bellard
                 0x00000000);
482 3fc6c082 bellard
}
483 3fc6c082 bellard
484 3fc6c082 bellard
/* SPR common to all non-embedded PowerPC, including 601 */
485 3fc6c082 bellard
static void gen_spr_ne_601 (CPUPPCState *env)
486 3fc6c082 bellard
{
487 3fc6c082 bellard
    /* Exception processing */
488 3fc6c082 bellard
    spr_register(env, SPR_DSISR, "DSISR",
489 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
490 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
491 3fc6c082 bellard
                 0x00000000);
492 3fc6c082 bellard
    spr_register(env, SPR_DAR, "DAR",
493 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
494 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
495 3fc6c082 bellard
                 0x00000000);
496 3fc6c082 bellard
    /* Timer */
497 3fc6c082 bellard
    spr_register(env, SPR_DECR, "DECR",
498 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
499 3fc6c082 bellard
                 &spr_read_decr, &spr_write_decr,
500 3fc6c082 bellard
                 0x00000000);
501 3fc6c082 bellard
    /* Memory management */
502 3fc6c082 bellard
    spr_register(env, SPR_SDR1, "SDR1",
503 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
504 3fc6c082 bellard
                 &spr_read_sdr1, &spr_write_sdr1,
505 3fc6c082 bellard
                 0x00000000);
506 3fc6c082 bellard
}
507 3fc6c082 bellard
508 3fc6c082 bellard
/* BATs 0-3 */
509 3fc6c082 bellard
static void gen_low_BATs (CPUPPCState *env)
510 3fc6c082 bellard
{
511 3fc6c082 bellard
    spr_register(env, SPR_IBAT0U, "IBAT0U",
512 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
513 3fc6c082 bellard
                 &spr_read_ibat, &spr_write_ibatu,
514 3fc6c082 bellard
                 0x00000000);
515 3fc6c082 bellard
    spr_register(env, SPR_IBAT0L, "IBAT0L",
516 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
517 3fc6c082 bellard
                 &spr_read_ibat, &spr_write_ibatl,
518 3fc6c082 bellard
                 0x00000000);
519 3fc6c082 bellard
    spr_register(env, SPR_IBAT1U, "IBAT1U",
520 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
521 3fc6c082 bellard
                 &spr_read_ibat, &spr_write_ibatu,
522 3fc6c082 bellard
                 0x00000000);
523 3fc6c082 bellard
    spr_register(env, SPR_IBAT1L, "IBAT1L",
524 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
525 3fc6c082 bellard
                 &spr_read_ibat, &spr_write_ibatl,
526 3fc6c082 bellard
                 0x00000000);
527 3fc6c082 bellard
    spr_register(env, SPR_IBAT2U, "IBAT2U",
528 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
529 3fc6c082 bellard
                 &spr_read_ibat, &spr_write_ibatu,
530 3fc6c082 bellard
                 0x00000000);
531 3fc6c082 bellard
    spr_register(env, SPR_IBAT2L, "IBAT2L",
532 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
533 3fc6c082 bellard
                 &spr_read_ibat, &spr_write_ibatl,
534 3fc6c082 bellard
                 0x00000000);
535 3fc6c082 bellard
    spr_register(env, SPR_IBAT3U, "IBAT3U",
536 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
537 3fc6c082 bellard
                 &spr_read_ibat, &spr_write_ibatu,
538 3fc6c082 bellard
                 0x00000000);
539 3fc6c082 bellard
    spr_register(env, SPR_IBAT3L, "IBAT3L",
540 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
541 3fc6c082 bellard
                 &spr_read_ibat, &spr_write_ibatl,
542 3fc6c082 bellard
                 0x00000000);
543 3fc6c082 bellard
    spr_register(env, SPR_DBAT0U, "DBAT0U",
544 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
545 3fc6c082 bellard
                 &spr_read_dbat, &spr_write_dbatu,
546 3fc6c082 bellard
                 0x00000000);
547 3fc6c082 bellard
    spr_register(env, SPR_DBAT0L, "DBAT0L",
548 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
549 3fc6c082 bellard
                 &spr_read_dbat, &spr_write_dbatl,
550 3fc6c082 bellard
                 0x00000000);
551 3fc6c082 bellard
    spr_register(env, SPR_DBAT1U, "DBAT1U",
552 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
553 3fc6c082 bellard
                 &spr_read_dbat, &spr_write_dbatu,
554 3fc6c082 bellard
                 0x00000000);
555 3fc6c082 bellard
    spr_register(env, SPR_DBAT1L, "DBAT1L",
556 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
557 3fc6c082 bellard
                 &spr_read_dbat, &spr_write_dbatl,
558 3fc6c082 bellard
                 0x00000000);
559 3fc6c082 bellard
    spr_register(env, SPR_DBAT2U, "DBAT2U",
560 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
561 3fc6c082 bellard
                 &spr_read_dbat, &spr_write_dbatu,
562 3fc6c082 bellard
                 0x00000000);
563 3fc6c082 bellard
    spr_register(env, SPR_DBAT2L, "DBAT2L",
564 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
565 3fc6c082 bellard
                 &spr_read_dbat, &spr_write_dbatl,
566 3fc6c082 bellard
                 0x00000000);
567 3fc6c082 bellard
    spr_register(env, SPR_DBAT3U, "DBAT3U",
568 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
569 3fc6c082 bellard
                 &spr_read_dbat, &spr_write_dbatu,
570 3fc6c082 bellard
                 0x00000000);
571 3fc6c082 bellard
    spr_register(env, SPR_DBAT3L, "DBAT3L",
572 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
573 3fc6c082 bellard
                 &spr_read_dbat, &spr_write_dbatl,
574 3fc6c082 bellard
                 0x00000000);
575 a750fc0b j_mayer
    env->nb_BATs += 4;
576 3fc6c082 bellard
}
577 3fc6c082 bellard
578 3fc6c082 bellard
/* BATs 4-7 */
579 3fc6c082 bellard
static void gen_high_BATs (CPUPPCState *env)
580 3fc6c082 bellard
{
581 3fc6c082 bellard
    spr_register(env, SPR_IBAT4U, "IBAT4U",
582 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
583 3fc6c082 bellard
                 &spr_read_ibat_h, &spr_write_ibatu_h,
584 3fc6c082 bellard
                 0x00000000);
585 3fc6c082 bellard
    spr_register(env, SPR_IBAT4L, "IBAT4L",
586 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
587 3fc6c082 bellard
                 &spr_read_ibat_h, &spr_write_ibatl_h,
588 3fc6c082 bellard
                 0x00000000);
589 3fc6c082 bellard
    spr_register(env, SPR_IBAT5U, "IBAT5U",
590 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
591 3fc6c082 bellard
                 &spr_read_ibat_h, &spr_write_ibatu_h,
592 3fc6c082 bellard
                 0x00000000);
593 3fc6c082 bellard
    spr_register(env, SPR_IBAT5L, "IBAT5L",
594 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
595 3fc6c082 bellard
                 &spr_read_ibat_h, &spr_write_ibatl_h,
596 3fc6c082 bellard
                 0x00000000);
597 3fc6c082 bellard
    spr_register(env, SPR_IBAT6U, "IBAT6U",
598 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
599 3fc6c082 bellard
                 &spr_read_ibat_h, &spr_write_ibatu_h,
600 3fc6c082 bellard
                 0x00000000);
601 3fc6c082 bellard
    spr_register(env, SPR_IBAT6L, "IBAT6L",
602 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
603 3fc6c082 bellard
                 &spr_read_ibat_h, &spr_write_ibatl_h,
604 3fc6c082 bellard
                 0x00000000);
605 3fc6c082 bellard
    spr_register(env, SPR_IBAT7U, "IBAT7U",
606 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
607 3fc6c082 bellard
                 &spr_read_ibat_h, &spr_write_ibatu_h,
608 3fc6c082 bellard
                 0x00000000);
609 3fc6c082 bellard
    spr_register(env, SPR_IBAT7L, "IBAT7L",
610 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
611 3fc6c082 bellard
                 &spr_read_ibat_h, &spr_write_ibatl_h,
612 3fc6c082 bellard
                 0x00000000);
613 3fc6c082 bellard
    spr_register(env, SPR_DBAT4U, "DBAT4U",
614 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
615 3fc6c082 bellard
                 &spr_read_dbat_h, &spr_write_dbatu_h,
616 3fc6c082 bellard
                 0x00000000);
617 3fc6c082 bellard
    spr_register(env, SPR_DBAT4L, "DBAT4L",
618 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
619 3fc6c082 bellard
                 &spr_read_dbat_h, &spr_write_dbatl_h,
620 3fc6c082 bellard
                 0x00000000);
621 3fc6c082 bellard
    spr_register(env, SPR_DBAT5U, "DBAT5U",
622 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
623 3fc6c082 bellard
                 &spr_read_dbat_h, &spr_write_dbatu_h,
624 3fc6c082 bellard
                 0x00000000);
625 3fc6c082 bellard
    spr_register(env, SPR_DBAT5L, "DBAT5L",
626 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
627 3fc6c082 bellard
                 &spr_read_dbat_h, &spr_write_dbatl_h,
628 3fc6c082 bellard
                 0x00000000);
629 3fc6c082 bellard
    spr_register(env, SPR_DBAT6U, "DBAT6U",
630 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
631 3fc6c082 bellard
                 &spr_read_dbat_h, &spr_write_dbatu_h,
632 3fc6c082 bellard
                 0x00000000);
633 3fc6c082 bellard
    spr_register(env, SPR_DBAT6L, "DBAT6L",
634 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
635 3fc6c082 bellard
                 &spr_read_dbat_h, &spr_write_dbatl_h,
636 3fc6c082 bellard
                 0x00000000);
637 3fc6c082 bellard
    spr_register(env, SPR_DBAT7U, "DBAT7U",
638 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
639 3fc6c082 bellard
                 &spr_read_dbat_h, &spr_write_dbatu_h,
640 3fc6c082 bellard
                 0x00000000);
641 3fc6c082 bellard
    spr_register(env, SPR_DBAT7L, "DBAT7L",
642 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
643 3fc6c082 bellard
                 &spr_read_dbat_h, &spr_write_dbatl_h,
644 3fc6c082 bellard
                 0x00000000);
645 a750fc0b j_mayer
    env->nb_BATs += 4;
646 3fc6c082 bellard
}
647 3fc6c082 bellard
648 3fc6c082 bellard
/* Generic PowerPC time base */
649 3fc6c082 bellard
static void gen_tbl (CPUPPCState *env)
650 3fc6c082 bellard
{
651 3fc6c082 bellard
    spr_register(env, SPR_VTBL,  "TBL",
652 3fc6c082 bellard
                 &spr_read_tbl, SPR_NOACCESS,
653 3fc6c082 bellard
                 &spr_read_tbl, SPR_NOACCESS,
654 3fc6c082 bellard
                 0x00000000);
655 3fc6c082 bellard
    spr_register(env, SPR_TBL,   "TBL",
656 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
657 3fc6c082 bellard
                 SPR_NOACCESS, &spr_write_tbl,
658 3fc6c082 bellard
                 0x00000000);
659 3fc6c082 bellard
    spr_register(env, SPR_VTBU,  "TBU",
660 3fc6c082 bellard
                 &spr_read_tbu, SPR_NOACCESS,
661 3fc6c082 bellard
                 &spr_read_tbu, SPR_NOACCESS,
662 3fc6c082 bellard
                 0x00000000);
663 3fc6c082 bellard
    spr_register(env, SPR_TBU,   "TBU",
664 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
665 3fc6c082 bellard
                 SPR_NOACCESS, &spr_write_tbu,
666 3fc6c082 bellard
                 0x00000000);
667 3fc6c082 bellard
}
668 3fc6c082 bellard
669 76a66253 j_mayer
/* Softare table search registers */
670 76a66253 j_mayer
static void gen_6xx_7xx_soft_tlb (CPUPPCState *env, int nb_tlbs, int nb_ways)
671 76a66253 j_mayer
{
672 76a66253 j_mayer
    env->nb_tlb = nb_tlbs;
673 76a66253 j_mayer
    env->nb_ways = nb_ways;
674 76a66253 j_mayer
    env->id_tlbs = 1;
675 76a66253 j_mayer
    spr_register(env, SPR_DMISS, "DMISS",
676 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
677 76a66253 j_mayer
                 &spr_read_generic, SPR_NOACCESS,
678 76a66253 j_mayer
                 0x00000000);
679 76a66253 j_mayer
    spr_register(env, SPR_DCMP, "DCMP",
680 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
681 76a66253 j_mayer
                 &spr_read_generic, SPR_NOACCESS,
682 76a66253 j_mayer
                 0x00000000);
683 76a66253 j_mayer
    spr_register(env, SPR_HASH1, "HASH1",
684 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
685 76a66253 j_mayer
                 &spr_read_generic, SPR_NOACCESS,
686 76a66253 j_mayer
                 0x00000000);
687 76a66253 j_mayer
    spr_register(env, SPR_HASH2, "HASH2",
688 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
689 76a66253 j_mayer
                 &spr_read_generic, SPR_NOACCESS,
690 76a66253 j_mayer
                 0x00000000);
691 76a66253 j_mayer
    spr_register(env, SPR_IMISS, "IMISS",
692 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
693 76a66253 j_mayer
                 &spr_read_generic, SPR_NOACCESS,
694 76a66253 j_mayer
                 0x00000000);
695 76a66253 j_mayer
    spr_register(env, SPR_ICMP, "ICMP",
696 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
697 76a66253 j_mayer
                 &spr_read_generic, SPR_NOACCESS,
698 76a66253 j_mayer
                 0x00000000);
699 76a66253 j_mayer
    spr_register(env, SPR_RPA, "RPA",
700 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
701 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
702 76a66253 j_mayer
                 0x00000000);
703 76a66253 j_mayer
}
704 76a66253 j_mayer
705 76a66253 j_mayer
/* SPR common to MPC755 and G2 */
706 76a66253 j_mayer
static void gen_spr_G2_755 (CPUPPCState *env)
707 76a66253 j_mayer
{
708 76a66253 j_mayer
    /* SGPRs */
709 76a66253 j_mayer
    spr_register(env, SPR_SPRG4, "SPRG4",
710 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
711 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
712 76a66253 j_mayer
                 0x00000000);
713 76a66253 j_mayer
    spr_register(env, SPR_SPRG5, "SPRG5",
714 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
715 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
716 76a66253 j_mayer
                 0x00000000);
717 76a66253 j_mayer
    spr_register(env, SPR_SPRG6, "SPRG6",
718 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
719 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
720 76a66253 j_mayer
                 0x00000000);
721 76a66253 j_mayer
    spr_register(env, SPR_SPRG7, "SPRG7",
722 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
723 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
724 76a66253 j_mayer
                 0x00000000);
725 76a66253 j_mayer
    /* External access control */
726 76a66253 j_mayer
    /* XXX : not implemented */
727 76a66253 j_mayer
    spr_register(env, SPR_EAR, "EAR",
728 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
729 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
730 76a66253 j_mayer
                 0x00000000);
731 76a66253 j_mayer
}
732 76a66253 j_mayer
733 3fc6c082 bellard
/* SPR common to all 7xx PowerPC implementations */
734 3fc6c082 bellard
static void gen_spr_7xx (CPUPPCState *env)
735 3fc6c082 bellard
{
736 3fc6c082 bellard
    /* Breakpoints */
737 3fc6c082 bellard
    /* XXX : not implemented */
738 3fc6c082 bellard
    spr_register(env, SPR_DABR, "DABR",
739 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
740 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
741 3fc6c082 bellard
                 0x00000000);
742 3fc6c082 bellard
    /* XXX : not implemented */
743 3fc6c082 bellard
    spr_register(env, SPR_IABR, "IABR",
744 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
745 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
746 3fc6c082 bellard
                 0x00000000);
747 3fc6c082 bellard
    /* Cache management */
748 3fc6c082 bellard
    /* XXX : not implemented */
749 3fc6c082 bellard
    spr_register(env, SPR_ICTC, "ICTC",
750 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
751 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
752 3fc6c082 bellard
                 0x00000000);
753 76a66253 j_mayer
    /* XXX : not implemented */
754 76a66253 j_mayer
    spr_register(env, SPR_L2CR, "L2CR",
755 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
756 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
757 76a66253 j_mayer
                 0x00000000);
758 3fc6c082 bellard
    /* Performance monitors */
759 3fc6c082 bellard
    /* XXX : not implemented */
760 3fc6c082 bellard
    spr_register(env, SPR_MMCR0, "MMCR0",
761 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
762 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
763 3fc6c082 bellard
                 0x00000000);
764 3fc6c082 bellard
    /* XXX : not implemented */
765 3fc6c082 bellard
    spr_register(env, SPR_MMCR1, "MMCR1",
766 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
767 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
768 3fc6c082 bellard
                 0x00000000);
769 3fc6c082 bellard
    /* XXX : not implemented */
770 3fc6c082 bellard
    spr_register(env, SPR_PMC1, "PMC1",
771 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
772 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
773 3fc6c082 bellard
                 0x00000000);
774 3fc6c082 bellard
    /* XXX : not implemented */
775 3fc6c082 bellard
    spr_register(env, SPR_PMC2, "PMC2",
776 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
777 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
778 3fc6c082 bellard
                 0x00000000);
779 3fc6c082 bellard
    /* XXX : not implemented */
780 3fc6c082 bellard
    spr_register(env, SPR_PMC3, "PMC3",
781 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
782 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
783 3fc6c082 bellard
                 0x00000000);
784 3fc6c082 bellard
    /* XXX : not implemented */
785 3fc6c082 bellard
    spr_register(env, SPR_PMC4, "PMC4",
786 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
787 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
788 3fc6c082 bellard
                 0x00000000);
789 3fc6c082 bellard
    /* XXX : not implemented */
790 a750fc0b j_mayer
    spr_register(env, SPR_SIAR, "SIAR",
791 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
792 3fc6c082 bellard
                 &spr_read_generic, SPR_NOACCESS,
793 3fc6c082 bellard
                 0x00000000);
794 3fc6c082 bellard
    spr_register(env, SPR_UMMCR0, "UMMCR0",
795 3fc6c082 bellard
                 &spr_read_ureg, SPR_NOACCESS,
796 3fc6c082 bellard
                 &spr_read_ureg, SPR_NOACCESS,
797 3fc6c082 bellard
                 0x00000000);
798 3fc6c082 bellard
    spr_register(env, SPR_UMMCR1, "UMMCR1",
799 3fc6c082 bellard
                 &spr_read_ureg, SPR_NOACCESS,
800 3fc6c082 bellard
                 &spr_read_ureg, SPR_NOACCESS,
801 3fc6c082 bellard
                 0x00000000);
802 3fc6c082 bellard
    spr_register(env, SPR_UPMC1, "UPMC1",
803 3fc6c082 bellard
                 &spr_read_ureg, SPR_NOACCESS,
804 3fc6c082 bellard
                 &spr_read_ureg, SPR_NOACCESS,
805 3fc6c082 bellard
                 0x00000000);
806 3fc6c082 bellard
    spr_register(env, SPR_UPMC2, "UPMC2",
807 3fc6c082 bellard
                 &spr_read_ureg, SPR_NOACCESS,
808 3fc6c082 bellard
                 &spr_read_ureg, SPR_NOACCESS,
809 3fc6c082 bellard
                 0x00000000);
810 3fc6c082 bellard
    spr_register(env, SPR_UPMC3, "UPMC3",
811 3fc6c082 bellard
                 &spr_read_ureg, SPR_NOACCESS,
812 3fc6c082 bellard
                 &spr_read_ureg, SPR_NOACCESS,
813 3fc6c082 bellard
                 0x00000000);
814 3fc6c082 bellard
    spr_register(env, SPR_UPMC4, "UPMC4",
815 3fc6c082 bellard
                 &spr_read_ureg, SPR_NOACCESS,
816 3fc6c082 bellard
                 &spr_read_ureg, SPR_NOACCESS,
817 3fc6c082 bellard
                 0x00000000);
818 a750fc0b j_mayer
    spr_register(env, SPR_USIAR, "USIAR",
819 3fc6c082 bellard
                 &spr_read_ureg, SPR_NOACCESS,
820 3fc6c082 bellard
                 &spr_read_ureg, SPR_NOACCESS,
821 3fc6c082 bellard
                 0x00000000);
822 a750fc0b j_mayer
    /* External access control */
823 3fc6c082 bellard
    /* XXX : not implemented */
824 a750fc0b j_mayer
    spr_register(env, SPR_EAR, "EAR",
825 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
826 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
827 3fc6c082 bellard
                 0x00000000);
828 a750fc0b j_mayer
}
829 a750fc0b j_mayer
830 a750fc0b j_mayer
static void gen_spr_thrm (CPUPPCState *env)
831 a750fc0b j_mayer
{
832 a750fc0b j_mayer
    /* Thermal management */
833 3fc6c082 bellard
    /* XXX : not implemented */
834 a750fc0b j_mayer
    spr_register(env, SPR_THRM1, "THRM1",
835 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
836 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
837 3fc6c082 bellard
                 0x00000000);
838 3fc6c082 bellard
    /* XXX : not implemented */
839 a750fc0b j_mayer
    spr_register(env, SPR_THRM2, "THRM2",
840 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
841 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
842 3fc6c082 bellard
                 0x00000000);
843 3fc6c082 bellard
    /* XXX : not implemented */
844 a750fc0b j_mayer
    spr_register(env, SPR_THRM3, "THRM3",
845 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
846 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
847 3fc6c082 bellard
                 0x00000000);
848 3fc6c082 bellard
}
849 3fc6c082 bellard
850 3fc6c082 bellard
/* SPR specific to PowerPC 604 implementation */
851 3fc6c082 bellard
static void gen_spr_604 (CPUPPCState *env)
852 3fc6c082 bellard
{
853 3fc6c082 bellard
    /* Processor identification */
854 3fc6c082 bellard
    spr_register(env, SPR_PIR, "PIR",
855 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
856 3fc6c082 bellard
                 &spr_read_generic, &spr_write_pir,
857 3fc6c082 bellard
                 0x00000000);
858 3fc6c082 bellard
    /* Breakpoints */
859 3fc6c082 bellard
    /* XXX : not implemented */
860 3fc6c082 bellard
    spr_register(env, SPR_IABR, "IABR",
861 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
862 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
863 3fc6c082 bellard
                 0x00000000);
864 3fc6c082 bellard
    /* XXX : not implemented */
865 3fc6c082 bellard
    spr_register(env, SPR_DABR, "DABR",
866 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
867 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
868 3fc6c082 bellard
                 0x00000000);
869 3fc6c082 bellard
    /* Performance counters */
870 3fc6c082 bellard
    /* XXX : not implemented */
871 3fc6c082 bellard
    spr_register(env, SPR_MMCR0, "MMCR0",
872 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
873 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
874 3fc6c082 bellard
                 0x00000000);
875 3fc6c082 bellard
    /* XXX : not implemented */
876 3fc6c082 bellard
    spr_register(env, SPR_MMCR1, "MMCR1",
877 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
878 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
879 3fc6c082 bellard
                 0x00000000);
880 3fc6c082 bellard
    /* XXX : not implemented */
881 3fc6c082 bellard
    spr_register(env, SPR_PMC1, "PMC1",
882 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
883 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
884 3fc6c082 bellard
                 0x00000000);
885 3fc6c082 bellard
    /* XXX : not implemented */
886 3fc6c082 bellard
    spr_register(env, SPR_PMC2, "PMC2",
887 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
888 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
889 3fc6c082 bellard
                 0x00000000);
890 3fc6c082 bellard
    /* XXX : not implemented */
891 3fc6c082 bellard
    spr_register(env, SPR_PMC3, "PMC3",
892 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
893 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
894 3fc6c082 bellard
                 0x00000000);
895 3fc6c082 bellard
    /* XXX : not implemented */
896 3fc6c082 bellard
    spr_register(env, SPR_PMC4, "PMC4",
897 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
898 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
899 3fc6c082 bellard
                 0x00000000);
900 3fc6c082 bellard
    /* XXX : not implemented */
901 a750fc0b j_mayer
    spr_register(env, SPR_SIAR, "SIAR",
902 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
903 3fc6c082 bellard
                 &spr_read_generic, SPR_NOACCESS,
904 3fc6c082 bellard
                 0x00000000);
905 3fc6c082 bellard
    /* XXX : not implemented */
906 3fc6c082 bellard
    spr_register(env, SPR_SDA, "SDA",
907 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
908 3fc6c082 bellard
                 &spr_read_generic, SPR_NOACCESS,
909 3fc6c082 bellard
                 0x00000000);
910 3fc6c082 bellard
    /* External access control */
911 3fc6c082 bellard
    /* XXX : not implemented */
912 3fc6c082 bellard
    spr_register(env, SPR_EAR, "EAR",
913 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
914 3fc6c082 bellard
                 &spr_read_generic, &spr_write_generic,
915 3fc6c082 bellard
                 0x00000000);
916 3fc6c082 bellard
}
917 3fc6c082 bellard
918 76a66253 j_mayer
/* SPR specific to PowerPC 603 implementation */
919 76a66253 j_mayer
static void gen_spr_603 (CPUPPCState *env)
920 3fc6c082 bellard
{
921 76a66253 j_mayer
    /* External access control */
922 76a66253 j_mayer
    /* XXX : not implemented */
923 76a66253 j_mayer
    spr_register(env, SPR_EAR, "EAR",
924 3fc6c082 bellard
                 SPR_NOACCESS, SPR_NOACCESS,
925 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
926 76a66253 j_mayer
                 0x00000000);
927 3fc6c082 bellard
}
928 3fc6c082 bellard
929 76a66253 j_mayer
/* SPR specific to PowerPC G2 implementation */
930 76a66253 j_mayer
static void gen_spr_G2 (CPUPPCState *env)
931 3fc6c082 bellard
{
932 76a66253 j_mayer
    /* Memory base address */
933 76a66253 j_mayer
    /* MBAR */
934 76a66253 j_mayer
    spr_register(env, SPR_MBAR, "MBAR",
935 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
936 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
937 76a66253 j_mayer
                 0x00000000);
938 76a66253 j_mayer
    /* System version register */
939 76a66253 j_mayer
    /* SVR */
940 76a66253 j_mayer
    spr_register(env, SPR_SVR, "SVR",
941 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
942 76a66253 j_mayer
                 &spr_read_generic, SPR_NOACCESS,
943 76a66253 j_mayer
                 0x00000000);
944 76a66253 j_mayer
    /* Exception processing */
945 363be49c j_mayer
    spr_register(env, SPR_BOOKE_CSRR0, "CSRR0",
946 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
947 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
948 76a66253 j_mayer
                 0x00000000);
949 363be49c j_mayer
    spr_register(env, SPR_BOOKE_CSRR1, "CSRR1",
950 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
951 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
952 76a66253 j_mayer
                 0x00000000);
953 76a66253 j_mayer
    /* Breakpoints */
954 76a66253 j_mayer
    /* XXX : not implemented */
955 76a66253 j_mayer
    spr_register(env, SPR_DABR, "DABR",
956 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
957 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
958 76a66253 j_mayer
                 0x00000000);
959 76a66253 j_mayer
    /* XXX : not implemented */
960 76a66253 j_mayer
    spr_register(env, SPR_DABR2, "DABR2",
961 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
962 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
963 76a66253 j_mayer
                 0x00000000);
964 76a66253 j_mayer
    /* XXX : not implemented */
965 76a66253 j_mayer
    spr_register(env, SPR_IABR, "IABR",
966 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
967 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
968 76a66253 j_mayer
                 0x00000000);
969 76a66253 j_mayer
    /* XXX : not implemented */
970 76a66253 j_mayer
    spr_register(env, SPR_IABR2, "IABR2",
971 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
972 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
973 76a66253 j_mayer
                 0x00000000);
974 76a66253 j_mayer
    /* XXX : not implemented */
975 76a66253 j_mayer
    spr_register(env, SPR_IBCR, "IBCR",
976 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
977 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
978 76a66253 j_mayer
                 0x00000000);
979 76a66253 j_mayer
    /* XXX : not implemented */
980 76a66253 j_mayer
    spr_register(env, SPR_DBCR, "DBCR",
981 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
982 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
983 76a66253 j_mayer
                 0x00000000);
984 76a66253 j_mayer
}
985 76a66253 j_mayer
986 76a66253 j_mayer
/* SPR specific to PowerPC 602 implementation */
987 76a66253 j_mayer
static void gen_spr_602 (CPUPPCState *env)
988 76a66253 j_mayer
{
989 76a66253 j_mayer
    /* ESA registers */
990 76a66253 j_mayer
    /* XXX : not implemented */
991 76a66253 j_mayer
    spr_register(env, SPR_SER, "SER",
992 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
993 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
994 76a66253 j_mayer
                 0x00000000);
995 76a66253 j_mayer
    /* XXX : not implemented */
996 76a66253 j_mayer
    spr_register(env, SPR_SEBR, "SEBR",
997 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
998 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
999 76a66253 j_mayer
                 0x00000000);
1000 76a66253 j_mayer
    /* XXX : not implemented */
1001 a750fc0b j_mayer
    spr_register(env, SPR_ESASRR, "ESASRR",
1002 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1003 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1004 76a66253 j_mayer
                 0x00000000);
1005 76a66253 j_mayer
    /* Floating point status */
1006 76a66253 j_mayer
    /* XXX : not implemented */
1007 76a66253 j_mayer
    spr_register(env, SPR_SP, "SP",
1008 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1009 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1010 76a66253 j_mayer
                 0x00000000);
1011 76a66253 j_mayer
    /* XXX : not implemented */
1012 76a66253 j_mayer
    spr_register(env, SPR_LT, "LT",
1013 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1014 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1015 76a66253 j_mayer
                 0x00000000);
1016 76a66253 j_mayer
    /* Watchdog timer */
1017 76a66253 j_mayer
    /* XXX : not implemented */
1018 76a66253 j_mayer
    spr_register(env, SPR_TCR, "TCR",
1019 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1020 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1021 76a66253 j_mayer
                 0x00000000);
1022 76a66253 j_mayer
    /* Interrupt base */
1023 76a66253 j_mayer
    spr_register(env, SPR_IBR, "IBR",
1024 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1025 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1026 76a66253 j_mayer
                 0x00000000);
1027 a750fc0b j_mayer
    /* XXX : not implemented */
1028 a750fc0b j_mayer
    spr_register(env, SPR_IABR, "IABR",
1029 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1030 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
1031 a750fc0b j_mayer
                 0x00000000);
1032 76a66253 j_mayer
}
1033 76a66253 j_mayer
1034 76a66253 j_mayer
/* SPR specific to PowerPC 601 implementation */
1035 76a66253 j_mayer
static void gen_spr_601 (CPUPPCState *env)
1036 76a66253 j_mayer
{
1037 76a66253 j_mayer
    /* Multiplication/division register */
1038 76a66253 j_mayer
    /* MQ */
1039 76a66253 j_mayer
    spr_register(env, SPR_MQ, "MQ",
1040 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1041 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1042 76a66253 j_mayer
                 0x00000000);
1043 76a66253 j_mayer
    /* RTC registers */
1044 76a66253 j_mayer
    spr_register(env, SPR_601_RTCU, "RTCU",
1045 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1046 76a66253 j_mayer
                 SPR_NOACCESS, &spr_write_601_rtcu,
1047 76a66253 j_mayer
                 0x00000000);
1048 76a66253 j_mayer
    spr_register(env, SPR_601_VRTCU, "RTCU",
1049 76a66253 j_mayer
                 &spr_read_601_rtcu, SPR_NOACCESS,
1050 76a66253 j_mayer
                 &spr_read_601_rtcu, SPR_NOACCESS,
1051 76a66253 j_mayer
                 0x00000000);
1052 76a66253 j_mayer
    spr_register(env, SPR_601_RTCL, "RTCL",
1053 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1054 76a66253 j_mayer
                 SPR_NOACCESS, &spr_write_601_rtcl,
1055 76a66253 j_mayer
                 0x00000000);
1056 76a66253 j_mayer
    spr_register(env, SPR_601_VRTCL, "RTCL",
1057 76a66253 j_mayer
                 &spr_read_601_rtcl, SPR_NOACCESS,
1058 76a66253 j_mayer
                 &spr_read_601_rtcl, SPR_NOACCESS,
1059 76a66253 j_mayer
                 0x00000000);
1060 76a66253 j_mayer
    /* Timer */
1061 76a66253 j_mayer
#if 0 /* ? */
1062 76a66253 j_mayer
    spr_register(env, SPR_601_UDECR, "UDECR",
1063 76a66253 j_mayer
                 &spr_read_decr, SPR_NOACCESS,
1064 76a66253 j_mayer
                 &spr_read_decr, SPR_NOACCESS,
1065 76a66253 j_mayer
                 0x00000000);
1066 76a66253 j_mayer
#endif
1067 76a66253 j_mayer
    /* External access control */
1068 76a66253 j_mayer
    /* XXX : not implemented */
1069 76a66253 j_mayer
    spr_register(env, SPR_EAR, "EAR",
1070 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1071 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1072 76a66253 j_mayer
                 0x00000000);
1073 76a66253 j_mayer
    /* Memory management */
1074 76a66253 j_mayer
    spr_register(env, SPR_IBAT0U, "IBAT0U",
1075 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1076 76a66253 j_mayer
                 &spr_read_601_ubat, &spr_write_601_ubatu,
1077 76a66253 j_mayer
                 0x00000000);
1078 76a66253 j_mayer
    spr_register(env, SPR_IBAT0L, "IBAT0L",
1079 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1080 76a66253 j_mayer
                 &spr_read_601_ubat, &spr_write_601_ubatl,
1081 76a66253 j_mayer
                 0x00000000);
1082 76a66253 j_mayer
    spr_register(env, SPR_IBAT1U, "IBAT1U",
1083 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1084 76a66253 j_mayer
                 &spr_read_601_ubat, &spr_write_601_ubatu,
1085 76a66253 j_mayer
                 0x00000000);
1086 76a66253 j_mayer
    spr_register(env, SPR_IBAT1L, "IBAT1L",
1087 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1088 76a66253 j_mayer
                 &spr_read_601_ubat, &spr_write_601_ubatl,
1089 76a66253 j_mayer
                 0x00000000);
1090 76a66253 j_mayer
    spr_register(env, SPR_IBAT2U, "IBAT2U",
1091 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1092 76a66253 j_mayer
                 &spr_read_601_ubat, &spr_write_601_ubatu,
1093 76a66253 j_mayer
                 0x00000000);
1094 76a66253 j_mayer
    spr_register(env, SPR_IBAT2L, "IBAT2L",
1095 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1096 76a66253 j_mayer
                 &spr_read_601_ubat, &spr_write_601_ubatl,
1097 76a66253 j_mayer
                 0x00000000);
1098 76a66253 j_mayer
    spr_register(env, SPR_IBAT3U, "IBAT3U",
1099 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1100 76a66253 j_mayer
                 &spr_read_601_ubat, &spr_write_601_ubatu,
1101 76a66253 j_mayer
                 0x00000000);
1102 76a66253 j_mayer
    spr_register(env, SPR_IBAT3L, "IBAT3L",
1103 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1104 76a66253 j_mayer
                 &spr_read_601_ubat, &spr_write_601_ubatl,
1105 76a66253 j_mayer
                 0x00000000);
1106 a750fc0b j_mayer
    env->nb_BATs = 4;
1107 a750fc0b j_mayer
}
1108 a750fc0b j_mayer
1109 a750fc0b j_mayer
static void gen_spr_74xx (CPUPPCState *env)
1110 a750fc0b j_mayer
{
1111 a750fc0b j_mayer
    /* Processor identification */
1112 a750fc0b j_mayer
    spr_register(env, SPR_PIR, "PIR",
1113 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1114 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_pir,
1115 a750fc0b j_mayer
                 0x00000000);
1116 a750fc0b j_mayer
    /* XXX : not implemented */
1117 a750fc0b j_mayer
    spr_register(env, SPR_MMCR2, "MMCR2",
1118 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1119 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
1120 a750fc0b j_mayer
                 0x00000000);
1121 a750fc0b j_mayer
    spr_register(env, SPR_UMMCR2, "UMMCR2",
1122 a750fc0b j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1123 a750fc0b j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1124 a750fc0b j_mayer
                 0x00000000);
1125 a750fc0b j_mayer
    /* XXX: not implemented */
1126 a750fc0b j_mayer
    spr_register(env, SPR_BAMR, "BAMR",
1127 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1128 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
1129 a750fc0b j_mayer
                 0x00000000);
1130 a750fc0b j_mayer
    spr_register(env, SPR_UBAMR, "UBAMR",
1131 a750fc0b j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1132 a750fc0b j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1133 a750fc0b j_mayer
                 0x00000000);
1134 a750fc0b j_mayer
    spr_register(env, SPR_MSSCR0, "MSSCR0",
1135 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1136 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
1137 a750fc0b j_mayer
                 0x00000000);
1138 a750fc0b j_mayer
    /* Hardware implementation registers */
1139 a750fc0b j_mayer
    /* XXX : not implemented */
1140 a750fc0b j_mayer
    spr_register(env, SPR_HID0, "HID0",
1141 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1142 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
1143 a750fc0b j_mayer
                 0x00000000);
1144 a750fc0b j_mayer
    /* XXX : not implemented */
1145 a750fc0b j_mayer
    spr_register(env, SPR_HID1, "HID1",
1146 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1147 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
1148 a750fc0b j_mayer
                 0x00000000);
1149 a750fc0b j_mayer
    /* Altivec */
1150 a750fc0b j_mayer
    spr_register(env, SPR_VRSAVE, "VRSAVE",
1151 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
1152 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
1153 a750fc0b j_mayer
                 0x00000000);
1154 a750fc0b j_mayer
}
1155 a750fc0b j_mayer
1156 a750fc0b j_mayer
#if defined (TODO)
1157 a750fc0b j_mayer
static void gen_l3_ctrl (CPUPPCState *env)
1158 a750fc0b j_mayer
{
1159 a750fc0b j_mayer
    /* L3CR */
1160 a750fc0b j_mayer
    /* XXX : not implemented */
1161 a750fc0b j_mayer
    spr_register(env, SPR_L3CR, "L3CR",
1162 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1163 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
1164 a750fc0b j_mayer
                 0x00000000);
1165 a750fc0b j_mayer
    /* L3ITCR0 */
1166 a750fc0b j_mayer
    spr_register(env, SPR_L3ITCR0, "L3ITCR0",
1167 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1168 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
1169 a750fc0b j_mayer
                 0x00000000);
1170 a750fc0b j_mayer
    /* L3ITCR1 */
1171 a750fc0b j_mayer
    spr_register(env, SPR_L3ITCR1, "L3ITCR1",
1172 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1173 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
1174 a750fc0b j_mayer
                 0x00000000);
1175 a750fc0b j_mayer
    /* L3ITCR2 */
1176 a750fc0b j_mayer
    spr_register(env, SPR_L3ITCR2, "L3ITCR2",
1177 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1178 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
1179 a750fc0b j_mayer
                 0x00000000);
1180 a750fc0b j_mayer
    /* L3ITCR3 */
1181 a750fc0b j_mayer
    spr_register(env, SPR_L3ITCR3, "L3ITCR3",
1182 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1183 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
1184 a750fc0b j_mayer
                 0x00000000);
1185 a750fc0b j_mayer
    /* L3OHCR */
1186 a750fc0b j_mayer
    spr_register(env, SPR_L3OHCR, "L3OHCR",
1187 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1188 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
1189 a750fc0b j_mayer
                 0x00000000);
1190 a750fc0b j_mayer
    /* L3PM */
1191 a750fc0b j_mayer
    spr_register(env, SPR_L3PM, "L3PM",
1192 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1193 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
1194 a750fc0b j_mayer
                 0x00000000);
1195 a750fc0b j_mayer
}
1196 a750fc0b j_mayer
#endif /* TODO */
1197 a750fc0b j_mayer
1198 a750fc0b j_mayer
#if defined (TODO)
1199 a750fc0b j_mayer
static void gen_74xx_soft_tlb (CPUPPCState *env)
1200 a750fc0b j_mayer
{
1201 a750fc0b j_mayer
    /* XXX: TODO */
1202 a750fc0b j_mayer
    spr_register(env, SPR_PTEHI, "PTEHI",
1203 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1204 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
1205 a750fc0b j_mayer
                 0x00000000);
1206 a750fc0b j_mayer
    spr_register(env, SPR_PTELO, "PTELO",
1207 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1208 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
1209 a750fc0b j_mayer
                 0x00000000);
1210 a750fc0b j_mayer
    spr_register(env, SPR_TLBMISS, "TLBMISS",
1211 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1212 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
1213 a750fc0b j_mayer
                 0x00000000);
1214 76a66253 j_mayer
}
1215 a750fc0b j_mayer
#endif /* TODO */
1216 76a66253 j_mayer
1217 76a66253 j_mayer
/* PowerPC BookE SPR */
1218 76a66253 j_mayer
static void gen_spr_BookE (CPUPPCState *env)
1219 76a66253 j_mayer
{
1220 76a66253 j_mayer
    /* Processor identification */
1221 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_PIR, "PIR",
1222 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1223 76a66253 j_mayer
                 &spr_read_generic, &spr_write_pir,
1224 76a66253 j_mayer
                 0x00000000);
1225 76a66253 j_mayer
    /* Interrupt processing */
1226 363be49c j_mayer
    spr_register(env, SPR_BOOKE_CSRR0, "CSRR0",
1227 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1228 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1229 76a66253 j_mayer
                 0x00000000);
1230 363be49c j_mayer
    spr_register(env, SPR_BOOKE_CSRR1, "CSRR1",
1231 363be49c j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1232 363be49c j_mayer
                 &spr_read_generic, &spr_write_generic,
1233 363be49c j_mayer
                 0x00000000);
1234 2662a059 j_mayer
#if 0
1235 363be49c j_mayer
    spr_register(env, SPR_BOOKE_DSRR0, "DSRR0",
1236 363be49c j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1237 363be49c j_mayer
                 &spr_read_generic, &spr_write_generic,
1238 363be49c j_mayer
                 0x00000000);
1239 363be49c j_mayer
    spr_register(env, SPR_BOOKE_DSRR1, "DSRR1",
1240 363be49c j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1241 363be49c j_mayer
                 &spr_read_generic, &spr_write_generic,
1242 363be49c j_mayer
                 0x00000000);
1243 2662a059 j_mayer
#endif
1244 76a66253 j_mayer
    /* Debug */
1245 76a66253 j_mayer
    /* XXX : not implemented */
1246 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_IAC1, "IAC1",
1247 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1248 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1249 76a66253 j_mayer
                 0x00000000);
1250 76a66253 j_mayer
    /* XXX : not implemented */
1251 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_IAC2, "IAC2",
1252 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1253 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1254 76a66253 j_mayer
                 0x00000000);
1255 76a66253 j_mayer
    /* XXX : not implemented */
1256 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_IAC3, "IAC3",
1257 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1258 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1259 76a66253 j_mayer
                 0x00000000);
1260 76a66253 j_mayer
    /* XXX : not implemented */
1261 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_IAC4, "IAC4",
1262 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1263 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1264 76a66253 j_mayer
                 0x00000000);
1265 76a66253 j_mayer
    /* XXX : not implemented */
1266 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_DAC1, "DAC1",
1267 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1268 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1269 76a66253 j_mayer
                 0x00000000);
1270 76a66253 j_mayer
    /* XXX : not implemented */
1271 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_DAC2, "DAC2",
1272 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1273 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1274 76a66253 j_mayer
                 0x00000000);
1275 76a66253 j_mayer
    /* XXX : not implemented */
1276 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_DVC1, "DVC1",
1277 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1278 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1279 76a66253 j_mayer
                 0x00000000);
1280 76a66253 j_mayer
    /* XXX : not implemented */
1281 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_DVC2, "DVC2",
1282 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1283 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1284 76a66253 j_mayer
                 0x00000000);
1285 76a66253 j_mayer
    /* XXX : not implemented */
1286 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_DBCR0, "DBCR0",
1287 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1288 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1289 76a66253 j_mayer
                 0x00000000);
1290 76a66253 j_mayer
    /* XXX : not implemented */
1291 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_DBCR1, "DBCR1",
1292 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1293 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1294 76a66253 j_mayer
                 0x00000000);
1295 76a66253 j_mayer
    /* XXX : not implemented */
1296 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_DBCR2, "DBCR2",
1297 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1298 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1299 76a66253 j_mayer
                 0x00000000);
1300 76a66253 j_mayer
    /* XXX : not implemented */
1301 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_DBSR, "DBSR",
1302 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1303 8ecc7913 j_mayer
                 &spr_read_generic, &spr_write_clear,
1304 76a66253 j_mayer
                 0x00000000);
1305 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_DEAR, "DEAR",
1306 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1307 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1308 76a66253 j_mayer
                 0x00000000);
1309 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_ESR, "ESR",
1310 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1311 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1312 76a66253 j_mayer
                 0x00000000);
1313 363be49c j_mayer
    spr_register(env, SPR_BOOKE_IVPR, "IVPR",
1314 363be49c j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1315 363be49c j_mayer
                 &spr_read_generic, &spr_write_generic,
1316 363be49c j_mayer
                 0x00000000);
1317 363be49c j_mayer
    /* Exception vectors */
1318 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_IVOR0, "IVOR0",
1319 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1320 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1321 76a66253 j_mayer
                 0x00000000);
1322 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_IVOR1, "IVOR1",
1323 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1324 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1325 76a66253 j_mayer
                 0x00000000);
1326 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_IVOR2, "IVOR2",
1327 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1328 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1329 76a66253 j_mayer
                 0x00000000);
1330 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_IVOR3, "IVOR3",
1331 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1332 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1333 76a66253 j_mayer
                 0x00000000);
1334 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_IVOR4, "IVOR4",
1335 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1336 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1337 76a66253 j_mayer
                 0x00000000);
1338 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_IVOR5, "IVOR5",
1339 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1340 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1341 76a66253 j_mayer
                 0x00000000);
1342 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_IVOR6, "IVOR6",
1343 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1344 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1345 76a66253 j_mayer
                 0x00000000);
1346 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_IVOR7, "IVOR7",
1347 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1348 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1349 76a66253 j_mayer
                 0x00000000);
1350 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_IVOR8, "IVOR8",
1351 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1352 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1353 76a66253 j_mayer
                 0x00000000);
1354 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_IVOR9, "IVOR9",
1355 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1356 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1357 76a66253 j_mayer
                 0x00000000);
1358 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_IVOR10, "IVOR10",
1359 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1360 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1361 76a66253 j_mayer
                 0x00000000);
1362 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_IVOR11, "IVOR11",
1363 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1364 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1365 76a66253 j_mayer
                 0x00000000);
1366 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_IVOR12, "IVOR12",
1367 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1368 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1369 76a66253 j_mayer
                 0x00000000);
1370 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_IVOR13, "IVOR13",
1371 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1372 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1373 76a66253 j_mayer
                 0x00000000);
1374 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_IVOR14, "IVOR14",
1375 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1376 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1377 76a66253 j_mayer
                 0x00000000);
1378 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_IVOR15, "IVOR15",
1379 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1380 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1381 76a66253 j_mayer
                 0x00000000);
1382 2662a059 j_mayer
#if 0
1383 363be49c j_mayer
    spr_register(env, SPR_BOOKE_IVOR32, "IVOR32",
1384 363be49c j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1385 363be49c j_mayer
                 &spr_read_generic, &spr_write_generic,
1386 363be49c j_mayer
                 0x00000000);
1387 363be49c j_mayer
    spr_register(env, SPR_BOOKE_IVOR33, "IVOR33",
1388 363be49c j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1389 363be49c j_mayer
                 &spr_read_generic, &spr_write_generic,
1390 363be49c j_mayer
                 0x00000000);
1391 363be49c j_mayer
    spr_register(env, SPR_BOOKE_IVOR34, "IVOR34",
1392 363be49c j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1393 363be49c j_mayer
                 &spr_read_generic, &spr_write_generic,
1394 363be49c j_mayer
                 0x00000000);
1395 363be49c j_mayer
    spr_register(env, SPR_BOOKE_IVOR35, "IVOR35",
1396 363be49c j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1397 363be49c j_mayer
                 &spr_read_generic, &spr_write_generic,
1398 363be49c j_mayer
                 0x00000000);
1399 363be49c j_mayer
    spr_register(env, SPR_BOOKE_IVOR36, "IVOR36",
1400 363be49c j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1401 363be49c j_mayer
                 &spr_read_generic, &spr_write_generic,
1402 363be49c j_mayer
                 0x00000000);
1403 363be49c j_mayer
    spr_register(env, SPR_BOOKE_IVOR37, "IVOR37",
1404 363be49c j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1405 363be49c j_mayer
                 &spr_read_generic, &spr_write_generic,
1406 363be49c j_mayer
                 0x00000000);
1407 2662a059 j_mayer
#endif
1408 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_PID, "PID",
1409 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1410 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1411 76a66253 j_mayer
                 0x00000000);
1412 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_TCR, "TCR",
1413 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1414 76a66253 j_mayer
                 &spr_read_generic, &spr_write_booke_tcr,
1415 76a66253 j_mayer
                 0x00000000);
1416 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_TSR, "TSR",
1417 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1418 76a66253 j_mayer
                 &spr_read_generic, &spr_write_booke_tsr,
1419 76a66253 j_mayer
                 0x00000000);
1420 76a66253 j_mayer
    /* Timer */
1421 76a66253 j_mayer
    spr_register(env, SPR_DECR, "DECR",
1422 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1423 76a66253 j_mayer
                 &spr_read_decr, &spr_write_decr,
1424 76a66253 j_mayer
                 0x00000000);
1425 76a66253 j_mayer
    spr_register(env, SPR_BOOKE_DECAR, "DECAR",
1426 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1427 76a66253 j_mayer
                 SPR_NOACCESS, &spr_write_generic,
1428 76a66253 j_mayer
                 0x00000000);
1429 76a66253 j_mayer
    /* SPRGs */
1430 76a66253 j_mayer
    spr_register(env, SPR_USPRG0, "USPRG0",
1431 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1432 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1433 76a66253 j_mayer
                 0x00000000);
1434 76a66253 j_mayer
    spr_register(env, SPR_SPRG4, "SPRG4",
1435 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1436 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1437 76a66253 j_mayer
                 0x00000000);
1438 76a66253 j_mayer
    spr_register(env, SPR_USPRG4, "USPRG4",
1439 76a66253 j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1440 76a66253 j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1441 76a66253 j_mayer
                 0x00000000);
1442 76a66253 j_mayer
    spr_register(env, SPR_SPRG5, "SPRG5",
1443 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1444 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1445 76a66253 j_mayer
                 0x00000000);
1446 76a66253 j_mayer
    spr_register(env, SPR_USPRG5, "USPRG5",
1447 76a66253 j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1448 76a66253 j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1449 76a66253 j_mayer
                 0x00000000);
1450 76a66253 j_mayer
    spr_register(env, SPR_SPRG6, "SPRG6",
1451 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1452 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1453 76a66253 j_mayer
                 0x00000000);
1454 76a66253 j_mayer
    spr_register(env, SPR_USPRG6, "USPRG6",
1455 76a66253 j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1456 76a66253 j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1457 76a66253 j_mayer
                 0x00000000);
1458 76a66253 j_mayer
    spr_register(env, SPR_SPRG7, "SPRG7",
1459 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1460 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1461 76a66253 j_mayer
                 0x00000000);
1462 76a66253 j_mayer
    spr_register(env, SPR_USPRG7, "USPRG7",
1463 76a66253 j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1464 76a66253 j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1465 76a66253 j_mayer
                 0x00000000);
1466 76a66253 j_mayer
}
1467 76a66253 j_mayer
1468 363be49c j_mayer
/* FSL storage control registers */
1469 a750fc0b j_mayer
#if defined(TODO)
1470 363be49c j_mayer
static void gen_spr_BookE_FSL (CPUPPCState *env)
1471 363be49c j_mayer
{
1472 363be49c j_mayer
    /* TLB assist registers */
1473 363be49c j_mayer
    spr_register(env, SPR_BOOKE_MAS0, "MAS0",
1474 363be49c j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1475 363be49c j_mayer
                 &spr_read_generic, &spr_write_generic,
1476 363be49c j_mayer
                 0x00000000);
1477 363be49c j_mayer
    spr_register(env, SPR_BOOKE_MAS1, "MAS2",
1478 363be49c j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1479 363be49c j_mayer
                 &spr_read_generic, &spr_write_generic,
1480 363be49c j_mayer
                 0x00000000);
1481 363be49c j_mayer
    spr_register(env, SPR_BOOKE_MAS2, "MAS3",
1482 363be49c j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1483 363be49c j_mayer
                 &spr_read_generic, &spr_write_generic,
1484 363be49c j_mayer
                 0x00000000);
1485 363be49c j_mayer
    spr_register(env, SPR_BOOKE_MAS3, "MAS4",
1486 363be49c j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1487 363be49c j_mayer
                 &spr_read_generic, &spr_write_generic,
1488 363be49c j_mayer
                 0x00000000);
1489 363be49c j_mayer
    spr_register(env, SPR_BOOKE_MAS4, "MAS5",
1490 363be49c j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1491 363be49c j_mayer
                 &spr_read_generic, &spr_write_generic,
1492 363be49c j_mayer
                 0x00000000);
1493 363be49c j_mayer
    spr_register(env, SPR_BOOKE_MAS6, "MAS6",
1494 363be49c j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1495 363be49c j_mayer
                 &spr_read_generic, &spr_write_generic,
1496 363be49c j_mayer
                 0x00000000);
1497 363be49c j_mayer
    spr_register(env, SPR_BOOKE_MAS7, "MAS7",
1498 363be49c j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1499 363be49c j_mayer
                 &spr_read_generic, &spr_write_generic,
1500 363be49c j_mayer
                 0x00000000);
1501 363be49c j_mayer
    if (env->nb_pids > 1) {
1502 363be49c j_mayer
        spr_register(env, SPR_BOOKE_PID1, "PID1",
1503 363be49c j_mayer
                     SPR_NOACCESS, SPR_NOACCESS,
1504 363be49c j_mayer
                     &spr_read_generic, &spr_write_generic,
1505 363be49c j_mayer
                     0x00000000);
1506 363be49c j_mayer
    }
1507 363be49c j_mayer
    if (env->nb_pids > 2) {
1508 363be49c j_mayer
        spr_register(env, SPR_BOOKE_PID2, "PID2",
1509 363be49c j_mayer
                     SPR_NOACCESS, SPR_NOACCESS,
1510 363be49c j_mayer
                     &spr_read_generic, &spr_write_generic,
1511 363be49c j_mayer
                     0x00000000);
1512 363be49c j_mayer
    }
1513 363be49c j_mayer
    spr_register(env, SPR_BOOKE_MMUCFG, "MMUCFG",
1514 363be49c j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1515 363be49c j_mayer
                 &spr_read_generic, SPR_NOACCESS,
1516 363be49c j_mayer
                 0x00000000); /* TOFIX */
1517 363be49c j_mayer
    spr_register(env, SPR_BOOKE_MMUCSR0, "MMUCSR0",
1518 363be49c j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1519 363be49c j_mayer
                 &spr_read_generic, &spr_write_generic,
1520 363be49c j_mayer
                 0x00000000); /* TOFIX */
1521 363be49c j_mayer
    switch (env->nb_ways) {
1522 363be49c j_mayer
    case 4:
1523 363be49c j_mayer
        spr_register(env, SPR_BOOKE_TLB3CFG, "TLB3CFG",
1524 363be49c j_mayer
                     SPR_NOACCESS, SPR_NOACCESS,
1525 363be49c j_mayer
                     &spr_read_generic, SPR_NOACCESS,
1526 363be49c j_mayer
                     0x00000000); /* TOFIX */
1527 363be49c j_mayer
        /* Fallthru */
1528 363be49c j_mayer
    case 3:
1529 363be49c j_mayer
        spr_register(env, SPR_BOOKE_TLB2CFG, "TLB2CFG",
1530 363be49c j_mayer
                     SPR_NOACCESS, SPR_NOACCESS,
1531 363be49c j_mayer
                     &spr_read_generic, SPR_NOACCESS,
1532 363be49c j_mayer
                     0x00000000); /* TOFIX */
1533 363be49c j_mayer
        /* Fallthru */
1534 363be49c j_mayer
    case 2:
1535 363be49c j_mayer
        spr_register(env, SPR_BOOKE_TLB1CFG, "TLB1CFG",
1536 363be49c j_mayer
                     SPR_NOACCESS, SPR_NOACCESS,
1537 363be49c j_mayer
                     &spr_read_generic, SPR_NOACCESS,
1538 363be49c j_mayer
                     0x00000000); /* TOFIX */
1539 363be49c j_mayer
        /* Fallthru */
1540 363be49c j_mayer
    case 1:
1541 363be49c j_mayer
        spr_register(env, SPR_BOOKE_TLB0CFG, "TLB0CFG",
1542 363be49c j_mayer
                     SPR_NOACCESS, SPR_NOACCESS,
1543 363be49c j_mayer
                     &spr_read_generic, SPR_NOACCESS,
1544 363be49c j_mayer
                     0x00000000); /* TOFIX */
1545 363be49c j_mayer
        /* Fallthru */
1546 363be49c j_mayer
    case 0:
1547 363be49c j_mayer
    default:
1548 363be49c j_mayer
        break;
1549 363be49c j_mayer
    }
1550 363be49c j_mayer
}
1551 a750fc0b j_mayer
#endif
1552 363be49c j_mayer
1553 76a66253 j_mayer
/* SPR specific to PowerPC 440 implementation */
1554 76a66253 j_mayer
static void gen_spr_440 (CPUPPCState *env)
1555 76a66253 j_mayer
{
1556 76a66253 j_mayer
    /* Cache control */
1557 76a66253 j_mayer
    /* XXX : not implemented */
1558 76a66253 j_mayer
    spr_register(env, SPR_440_DNV0, "DNV0",
1559 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1560 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1561 76a66253 j_mayer
                 0x00000000);
1562 76a66253 j_mayer
    /* XXX : not implemented */
1563 76a66253 j_mayer
    spr_register(env, SPR_440_DNV1, "DNV1",
1564 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1565 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1566 76a66253 j_mayer
                 0x00000000);
1567 76a66253 j_mayer
    /* XXX : not implemented */
1568 76a66253 j_mayer
    spr_register(env, SPR_440_DNV2, "DNV2",
1569 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1570 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1571 76a66253 j_mayer
                 0x00000000);
1572 76a66253 j_mayer
    /* XXX : not implemented */
1573 76a66253 j_mayer
    spr_register(env, SPR_440_DNV3, "DNV3",
1574 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1575 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1576 76a66253 j_mayer
                 0x00000000);
1577 76a66253 j_mayer
    /* XXX : not implemented */
1578 2662a059 j_mayer
    spr_register(env, SPR_440_DTV0, "DTV0",
1579 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1580 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1581 76a66253 j_mayer
                 0x00000000);
1582 76a66253 j_mayer
    /* XXX : not implemented */
1583 2662a059 j_mayer
    spr_register(env, SPR_440_DTV1, "DTV1",
1584 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1585 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1586 76a66253 j_mayer
                 0x00000000);
1587 76a66253 j_mayer
    /* XXX : not implemented */
1588 2662a059 j_mayer
    spr_register(env, SPR_440_DTV2, "DTV2",
1589 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1590 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1591 76a66253 j_mayer
                 0x00000000);
1592 76a66253 j_mayer
    /* XXX : not implemented */
1593 2662a059 j_mayer
    spr_register(env, SPR_440_DTV3, "DTV3",
1594 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1595 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1596 76a66253 j_mayer
                 0x00000000);
1597 76a66253 j_mayer
    /* XXX : not implemented */
1598 76a66253 j_mayer
    spr_register(env, SPR_440_DVLIM, "DVLIM",
1599 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1600 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1601 76a66253 j_mayer
                 0x00000000);
1602 76a66253 j_mayer
    /* XXX : not implemented */
1603 76a66253 j_mayer
    spr_register(env, SPR_440_INV0, "INV0",
1604 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1605 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1606 76a66253 j_mayer
                 0x00000000);
1607 76a66253 j_mayer
    /* XXX : not implemented */
1608 76a66253 j_mayer
    spr_register(env, SPR_440_INV1, "INV1",
1609 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1610 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1611 76a66253 j_mayer
                 0x00000000);
1612 76a66253 j_mayer
    /* XXX : not implemented */
1613 76a66253 j_mayer
    spr_register(env, SPR_440_INV2, "INV2",
1614 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1615 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1616 76a66253 j_mayer
                 0x00000000);
1617 76a66253 j_mayer
    /* XXX : not implemented */
1618 76a66253 j_mayer
    spr_register(env, SPR_440_INV3, "INV3",
1619 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1620 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1621 76a66253 j_mayer
                 0x00000000);
1622 76a66253 j_mayer
    /* XXX : not implemented */
1623 2662a059 j_mayer
    spr_register(env, SPR_440_ITV0, "ITV0",
1624 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1625 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1626 76a66253 j_mayer
                 0x00000000);
1627 76a66253 j_mayer
    /* XXX : not implemented */
1628 2662a059 j_mayer
    spr_register(env, SPR_440_ITV1, "ITV1",
1629 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1630 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1631 76a66253 j_mayer
                 0x00000000);
1632 76a66253 j_mayer
    /* XXX : not implemented */
1633 2662a059 j_mayer
    spr_register(env, SPR_440_ITV2, "ITV2",
1634 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1635 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1636 76a66253 j_mayer
                 0x00000000);
1637 76a66253 j_mayer
    /* XXX : not implemented */
1638 2662a059 j_mayer
    spr_register(env, SPR_440_ITV3, "ITV3",
1639 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1640 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1641 76a66253 j_mayer
                 0x00000000);
1642 76a66253 j_mayer
    /* XXX : not implemented */
1643 76a66253 j_mayer
    spr_register(env, SPR_440_IVLIM, "IVLIM",
1644 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1645 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1646 76a66253 j_mayer
                 0x00000000);
1647 76a66253 j_mayer
    /* Cache debug */
1648 76a66253 j_mayer
    /* XXX : not implemented */
1649 2662a059 j_mayer
    spr_register(env, SPR_BOOKE_DCDBTRH, "DCDBTRH",
1650 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1651 76a66253 j_mayer
                 &spr_read_generic, SPR_NOACCESS,
1652 76a66253 j_mayer
                 0x00000000);
1653 76a66253 j_mayer
    /* XXX : not implemented */
1654 2662a059 j_mayer
    spr_register(env, SPR_BOOKE_DCDBTRL, "DCDBTRL",
1655 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1656 76a66253 j_mayer
                 &spr_read_generic, SPR_NOACCESS,
1657 76a66253 j_mayer
                 0x00000000);
1658 76a66253 j_mayer
    /* XXX : not implemented */
1659 2662a059 j_mayer
    spr_register(env, SPR_BOOKE_ICDBDR, "ICDBDR",
1660 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1661 76a66253 j_mayer
                 &spr_read_generic, SPR_NOACCESS,
1662 76a66253 j_mayer
                 0x00000000);
1663 76a66253 j_mayer
    /* XXX : not implemented */
1664 2662a059 j_mayer
    spr_register(env, SPR_BOOKE_ICDBTRH, "ICDBTRH",
1665 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1666 76a66253 j_mayer
                 &spr_read_generic, SPR_NOACCESS,
1667 76a66253 j_mayer
                 0x00000000);
1668 76a66253 j_mayer
    /* XXX : not implemented */
1669 2662a059 j_mayer
    spr_register(env, SPR_BOOKE_ICDBTRL, "ICDBTRL",
1670 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1671 76a66253 j_mayer
                 &spr_read_generic, SPR_NOACCESS,
1672 76a66253 j_mayer
                 0x00000000);
1673 76a66253 j_mayer
    /* XXX : not implemented */
1674 76a66253 j_mayer
    spr_register(env, SPR_440_DBDR, "DBDR",
1675 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1676 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1677 76a66253 j_mayer
                 0x00000000);
1678 76a66253 j_mayer
    /* Processor control */
1679 76a66253 j_mayer
    spr_register(env, SPR_4xx_CCR0, "CCR0",
1680 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1681 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1682 76a66253 j_mayer
                 0x00000000);
1683 76a66253 j_mayer
    spr_register(env, SPR_440_RSTCFG, "RSTCFG",
1684 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1685 76a66253 j_mayer
                 &spr_read_generic, SPR_NOACCESS,
1686 76a66253 j_mayer
                 0x00000000);
1687 76a66253 j_mayer
    /* Storage control */
1688 76a66253 j_mayer
    spr_register(env, SPR_440_MMUCR, "MMUCR",
1689 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1690 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1691 76a66253 j_mayer
                 0x00000000);
1692 76a66253 j_mayer
}
1693 76a66253 j_mayer
1694 76a66253 j_mayer
/* SPR shared between PowerPC 40x implementations */
1695 76a66253 j_mayer
static void gen_spr_40x (CPUPPCState *env)
1696 76a66253 j_mayer
{
1697 76a66253 j_mayer
    /* Cache */
1698 76a66253 j_mayer
    /* XXX : not implemented */
1699 76a66253 j_mayer
    spr_register(env, SPR_40x_DCCR, "DCCR",
1700 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1701 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1702 76a66253 j_mayer
                 0x00000000);
1703 76a66253 j_mayer
    /* XXX : not implemented */
1704 76a66253 j_mayer
    spr_register(env, SPR_40x_ICCR, "ICCR",
1705 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1706 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1707 76a66253 j_mayer
                 0x00000000);
1708 76a66253 j_mayer
    /* XXX : not implemented */
1709 2662a059 j_mayer
    spr_register(env, SPR_BOOKE_ICDBDR, "ICDBDR",
1710 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1711 76a66253 j_mayer
                 &spr_read_generic, SPR_NOACCESS,
1712 76a66253 j_mayer
                 0x00000000);
1713 76a66253 j_mayer
    /* Exception */
1714 76a66253 j_mayer
    spr_register(env, SPR_40x_DEAR, "DEAR",
1715 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1716 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1717 76a66253 j_mayer
                 0x00000000);
1718 76a66253 j_mayer
    spr_register(env, SPR_40x_ESR, "ESR",
1719 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1720 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1721 76a66253 j_mayer
                 0x00000000);
1722 76a66253 j_mayer
    spr_register(env, SPR_40x_EVPR, "EVPR",
1723 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1724 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1725 76a66253 j_mayer
                 0x00000000);
1726 76a66253 j_mayer
    spr_register(env, SPR_40x_SRR2, "SRR2",
1727 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1728 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1729 76a66253 j_mayer
                 0x00000000);
1730 76a66253 j_mayer
    spr_register(env, SPR_40x_SRR3, "SRR3",
1731 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1732 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1733 76a66253 j_mayer
                 0x00000000);
1734 76a66253 j_mayer
    /* Timers */
1735 76a66253 j_mayer
    spr_register(env, SPR_40x_PIT, "PIT",
1736 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1737 76a66253 j_mayer
                 &spr_read_40x_pit, &spr_write_40x_pit,
1738 76a66253 j_mayer
                 0x00000000);
1739 76a66253 j_mayer
    spr_register(env, SPR_40x_TCR, "TCR",
1740 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1741 76a66253 j_mayer
                 &spr_read_generic, &spr_write_booke_tcr,
1742 76a66253 j_mayer
                 0x00000000);
1743 76a66253 j_mayer
    spr_register(env, SPR_40x_TSR, "TSR",
1744 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1745 76a66253 j_mayer
                 &spr_read_generic, &spr_write_booke_tsr,
1746 76a66253 j_mayer
                 0x00000000);
1747 2662a059 j_mayer
}
1748 2662a059 j_mayer
1749 2662a059 j_mayer
/* SPR specific to PowerPC 405 implementation */
1750 2662a059 j_mayer
static void gen_spr_405 (CPUPPCState *env)
1751 2662a059 j_mayer
{
1752 2662a059 j_mayer
    /* MMU */
1753 2662a059 j_mayer
    spr_register(env, SPR_40x_PID, "PID",
1754 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1755 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1756 76a66253 j_mayer
                 0x00000000);
1757 2662a059 j_mayer
    spr_register(env, SPR_4xx_CCR0, "CCR0",
1758 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1759 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1760 2662a059 j_mayer
                 0x00700000);
1761 2662a059 j_mayer
    /* Debug interface */
1762 76a66253 j_mayer
    /* XXX : not implemented */
1763 76a66253 j_mayer
    spr_register(env, SPR_40x_DBCR0, "DBCR0",
1764 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1765 8ecc7913 j_mayer
                 &spr_read_generic, &spr_write_40x_dbcr0,
1766 76a66253 j_mayer
                 0x00000000);
1767 76a66253 j_mayer
    /* XXX : not implemented */
1768 2662a059 j_mayer
    spr_register(env, SPR_405_DBCR1, "DBCR1",
1769 2662a059 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1770 2662a059 j_mayer
                 &spr_read_generic, &spr_write_generic,
1771 2662a059 j_mayer
                 0x00000000);
1772 2662a059 j_mayer
    /* XXX : not implemented */
1773 76a66253 j_mayer
    spr_register(env, SPR_40x_DBSR, "DBSR",
1774 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1775 8ecc7913 j_mayer
                 &spr_read_generic, &spr_write_clear,
1776 8ecc7913 j_mayer
                 /* Last reset was system reset */
1777 76a66253 j_mayer
                 0x00000300);
1778 76a66253 j_mayer
    /* XXX : not implemented */
1779 2662a059 j_mayer
    spr_register(env, SPR_40x_DAC1, "DAC1",
1780 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1781 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1782 76a66253 j_mayer
                 0x00000000);
1783 2662a059 j_mayer
    spr_register(env, SPR_40x_DAC2, "DAC2",
1784 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1785 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1786 76a66253 j_mayer
                 0x00000000);
1787 2662a059 j_mayer
    /* XXX : not implemented */
1788 2662a059 j_mayer
    spr_register(env, SPR_405_DVC1, "DVC1",
1789 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1790 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1791 2662a059 j_mayer
                 0x00000000);
1792 76a66253 j_mayer
    /* XXX : not implemented */
1793 2662a059 j_mayer
    spr_register(env, SPR_405_DVC2, "DVC2",
1794 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1795 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1796 76a66253 j_mayer
                 0x00000000);
1797 76a66253 j_mayer
    /* XXX : not implemented */
1798 2662a059 j_mayer
    spr_register(env, SPR_40x_IAC1, "IAC1",
1799 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1800 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1801 76a66253 j_mayer
                 0x00000000);
1802 2662a059 j_mayer
    spr_register(env, SPR_40x_IAC2, "IAC2",
1803 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1804 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1805 76a66253 j_mayer
                 0x00000000);
1806 76a66253 j_mayer
    /* XXX : not implemented */
1807 76a66253 j_mayer
    spr_register(env, SPR_405_IAC3, "IAC3",
1808 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1809 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1810 76a66253 j_mayer
                 0x00000000);
1811 76a66253 j_mayer
    /* XXX : not implemented */
1812 76a66253 j_mayer
    spr_register(env, SPR_405_IAC4, "IAC4",
1813 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1814 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1815 76a66253 j_mayer
                 0x00000000);
1816 76a66253 j_mayer
    /* Storage control */
1817 76a66253 j_mayer
    spr_register(env, SPR_405_SLER, "SLER",
1818 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1819 c294fc58 j_mayer
                 &spr_read_generic, &spr_write_40x_sler,
1820 76a66253 j_mayer
                 0x00000000);
1821 2662a059 j_mayer
    spr_register(env, SPR_40x_ZPR, "ZPR",
1822 2662a059 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1823 2662a059 j_mayer
                 &spr_read_generic, &spr_write_generic,
1824 2662a059 j_mayer
                 0x00000000);
1825 76a66253 j_mayer
    /* XXX : not implemented */
1826 76a66253 j_mayer
    spr_register(env, SPR_405_SU0R, "SU0R",
1827 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1828 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1829 76a66253 j_mayer
                 0x00000000);
1830 76a66253 j_mayer
    /* SPRG */
1831 76a66253 j_mayer
    spr_register(env, SPR_USPRG0, "USPRG0",
1832 76a66253 j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1833 76a66253 j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1834 76a66253 j_mayer
                 0x00000000);
1835 76a66253 j_mayer
    spr_register(env, SPR_SPRG4, "SPRG4",
1836 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1837 04f20795 j_mayer
                 &spr_read_generic, &spr_write_generic,
1838 76a66253 j_mayer
                 0x00000000);
1839 76a66253 j_mayer
    spr_register(env, SPR_USPRG4, "USPRG4",
1840 76a66253 j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1841 76a66253 j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1842 76a66253 j_mayer
                 0x00000000);
1843 76a66253 j_mayer
    spr_register(env, SPR_SPRG5, "SPRG5",
1844 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1845 04f20795 j_mayer
                 spr_read_generic, &spr_write_generic,
1846 76a66253 j_mayer
                 0x00000000);
1847 76a66253 j_mayer
    spr_register(env, SPR_USPRG5, "USPRG5",
1848 76a66253 j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1849 76a66253 j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1850 76a66253 j_mayer
                 0x00000000);
1851 76a66253 j_mayer
    spr_register(env, SPR_SPRG6, "SPRG6",
1852 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1853 04f20795 j_mayer
                 spr_read_generic, &spr_write_generic,
1854 76a66253 j_mayer
                 0x00000000);
1855 76a66253 j_mayer
    spr_register(env, SPR_USPRG6, "USPRG6",
1856 76a66253 j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1857 76a66253 j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1858 76a66253 j_mayer
                 0x00000000);
1859 76a66253 j_mayer
    spr_register(env, SPR_SPRG7, "SPRG7",
1860 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1861 04f20795 j_mayer
                 spr_read_generic, &spr_write_generic,
1862 76a66253 j_mayer
                 0x00000000);
1863 76a66253 j_mayer
    spr_register(env, SPR_USPRG7, "USPRG7",
1864 76a66253 j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1865 76a66253 j_mayer
                 &spr_read_ureg, SPR_NOACCESS,
1866 76a66253 j_mayer
                 0x00000000);
1867 76a66253 j_mayer
}
1868 76a66253 j_mayer
1869 76a66253 j_mayer
/* SPR shared between PowerPC 401 & 403 implementations */
1870 76a66253 j_mayer
static void gen_spr_401_403 (CPUPPCState *env)
1871 76a66253 j_mayer
{
1872 76a66253 j_mayer
    /* Time base */
1873 76a66253 j_mayer
    spr_register(env, SPR_403_VTBL,  "TBL",
1874 76a66253 j_mayer
                 &spr_read_tbl, SPR_NOACCESS,
1875 76a66253 j_mayer
                 &spr_read_tbl, SPR_NOACCESS,
1876 76a66253 j_mayer
                 0x00000000);
1877 76a66253 j_mayer
    spr_register(env, SPR_403_TBL,   "TBL",
1878 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1879 76a66253 j_mayer
                 SPR_NOACCESS, &spr_write_tbl,
1880 76a66253 j_mayer
                 0x00000000);
1881 76a66253 j_mayer
    spr_register(env, SPR_403_VTBU,  "TBU",
1882 76a66253 j_mayer
                 &spr_read_tbu, SPR_NOACCESS,
1883 76a66253 j_mayer
                 &spr_read_tbu, SPR_NOACCESS,
1884 76a66253 j_mayer
                 0x00000000);
1885 76a66253 j_mayer
    spr_register(env, SPR_403_TBU,   "TBU",
1886 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1887 76a66253 j_mayer
                 SPR_NOACCESS, &spr_write_tbu,
1888 76a66253 j_mayer
                 0x00000000);
1889 76a66253 j_mayer
    /* Debug */
1890 76a66253 j_mayer
    /* XXX: not implemented */
1891 76a66253 j_mayer
    spr_register(env, SPR_403_CDBCR, "CDBCR",
1892 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1893 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
1894 76a66253 j_mayer
                 0x00000000);
1895 76a66253 j_mayer
}
1896 76a66253 j_mayer
1897 2662a059 j_mayer
/* SPR specific to PowerPC 401 implementation */
1898 2662a059 j_mayer
static void gen_spr_401 (CPUPPCState *env)
1899 2662a059 j_mayer
{
1900 2662a059 j_mayer
    /* Debug interface */
1901 2662a059 j_mayer
    /* XXX : not implemented */
1902 2662a059 j_mayer
    spr_register(env, SPR_40x_DBCR0, "DBCR",
1903 2662a059 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1904 2662a059 j_mayer
                 &spr_read_generic, &spr_write_40x_dbcr0,
1905 2662a059 j_mayer
                 0x00000000);
1906 2662a059 j_mayer
    /* XXX : not implemented */
1907 2662a059 j_mayer
    spr_register(env, SPR_40x_DBSR, "DBSR",
1908 2662a059 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1909 2662a059 j_mayer
                 &spr_read_generic, &spr_write_clear,
1910 2662a059 j_mayer
                 /* Last reset was system reset */
1911 2662a059 j_mayer
                 0x00000300);
1912 2662a059 j_mayer
    /* XXX : not implemented */
1913 2662a059 j_mayer
    spr_register(env, SPR_40x_DAC1, "DAC",
1914 2662a059 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1915 2662a059 j_mayer
                 &spr_read_generic, &spr_write_generic,
1916 2662a059 j_mayer
                 0x00000000);
1917 2662a059 j_mayer
    /* XXX : not implemented */
1918 2662a059 j_mayer
    spr_register(env, SPR_40x_IAC1, "IAC",
1919 2662a059 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1920 2662a059 j_mayer
                 &spr_read_generic, &spr_write_generic,
1921 2662a059 j_mayer
                 0x00000000);
1922 2662a059 j_mayer
    /* Storage control */
1923 2662a059 j_mayer
    spr_register(env, SPR_405_SLER, "SLER",
1924 2662a059 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1925 2662a059 j_mayer
                 &spr_read_generic, &spr_write_40x_sler,
1926 2662a059 j_mayer
                 0x00000000);
1927 2662a059 j_mayer
}
1928 2662a059 j_mayer
1929 a750fc0b j_mayer
static void gen_spr_401x2 (CPUPPCState *env)
1930 a750fc0b j_mayer
{
1931 a750fc0b j_mayer
    gen_spr_401(env);
1932 a750fc0b j_mayer
    spr_register(env, SPR_40x_PID, "PID",
1933 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1934 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
1935 a750fc0b j_mayer
                 0x00000000);
1936 a750fc0b j_mayer
    spr_register(env, SPR_40x_ZPR, "ZPR",
1937 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1938 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
1939 a750fc0b j_mayer
                 0x00000000);
1940 a750fc0b j_mayer
}
1941 a750fc0b j_mayer
1942 76a66253 j_mayer
/* SPR specific to PowerPC 403 implementation */
1943 76a66253 j_mayer
static void gen_spr_403 (CPUPPCState *env)
1944 76a66253 j_mayer
{
1945 2662a059 j_mayer
    /* Debug interface */
1946 2662a059 j_mayer
    /* XXX : not implemented */
1947 2662a059 j_mayer
    spr_register(env, SPR_40x_DBCR0, "DBCR0",
1948 2662a059 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1949 2662a059 j_mayer
                 &spr_read_generic, &spr_write_40x_dbcr0,
1950 2662a059 j_mayer
                 0x00000000);
1951 2662a059 j_mayer
    /* XXX : not implemented */
1952 2662a059 j_mayer
    spr_register(env, SPR_40x_DBSR, "DBSR",
1953 2662a059 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1954 2662a059 j_mayer
                 &spr_read_generic, &spr_write_clear,
1955 2662a059 j_mayer
                 /* Last reset was system reset */
1956 2662a059 j_mayer
                 0x00000300);
1957 2662a059 j_mayer
    /* XXX : not implemented */
1958 2662a059 j_mayer
    spr_register(env, SPR_40x_DAC1, "DAC1",
1959 2662a059 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1960 2662a059 j_mayer
                 &spr_read_generic, &spr_write_generic,
1961 2662a059 j_mayer
                 0x00000000);
1962 2662a059 j_mayer
    spr_register(env, SPR_40x_DAC2, "DAC2",
1963 2662a059 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1964 2662a059 j_mayer
                 &spr_read_generic, &spr_write_generic,
1965 2662a059 j_mayer
                 0x00000000);
1966 2662a059 j_mayer
    /* XXX : not implemented */
1967 2662a059 j_mayer
    spr_register(env, SPR_40x_IAC1, "IAC1",
1968 2662a059 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1969 2662a059 j_mayer
                 &spr_read_generic, &spr_write_generic,
1970 2662a059 j_mayer
                 0x00000000);
1971 2662a059 j_mayer
    spr_register(env, SPR_40x_IAC2, "IAC2",
1972 2662a059 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1973 2662a059 j_mayer
                 &spr_read_generic, &spr_write_generic,
1974 2662a059 j_mayer
                 0x00000000);
1975 a750fc0b j_mayer
}
1976 a750fc0b j_mayer
1977 a750fc0b j_mayer
static void gen_spr_403_real (CPUPPCState *env)
1978 a750fc0b j_mayer
{
1979 76a66253 j_mayer
    spr_register(env, SPR_403_PBL1,  "PBL1",
1980 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1981 76a66253 j_mayer
                 &spr_read_403_pbr, &spr_write_403_pbr,
1982 76a66253 j_mayer
                 0x00000000);
1983 76a66253 j_mayer
    spr_register(env, SPR_403_PBU1,  "PBU1",
1984 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1985 76a66253 j_mayer
                 &spr_read_403_pbr, &spr_write_403_pbr,
1986 76a66253 j_mayer
                 0x00000000);
1987 76a66253 j_mayer
    spr_register(env, SPR_403_PBL2,  "PBL2",
1988 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1989 76a66253 j_mayer
                 &spr_read_403_pbr, &spr_write_403_pbr,
1990 76a66253 j_mayer
                 0x00000000);
1991 76a66253 j_mayer
    spr_register(env, SPR_403_PBU2,  "PBU2",
1992 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
1993 76a66253 j_mayer
                 &spr_read_403_pbr, &spr_write_403_pbr,
1994 76a66253 j_mayer
                 0x00000000);
1995 a750fc0b j_mayer
}
1996 a750fc0b j_mayer
1997 a750fc0b j_mayer
static void gen_spr_403_mmu (CPUPPCState *env)
1998 a750fc0b j_mayer
{
1999 a750fc0b j_mayer
    /* MMU */
2000 a750fc0b j_mayer
    spr_register(env, SPR_40x_PID, "PID",
2001 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2002 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
2003 a750fc0b j_mayer
                 0x00000000);
2004 2662a059 j_mayer
    spr_register(env, SPR_40x_ZPR, "ZPR",
2005 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2006 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
2007 76a66253 j_mayer
                 0x00000000);
2008 76a66253 j_mayer
}
2009 76a66253 j_mayer
2010 76a66253 j_mayer
/* SPR specific to PowerPC compression coprocessor extension */
2011 76a66253 j_mayer
static void gen_spr_compress (CPUPPCState *env)
2012 76a66253 j_mayer
{
2013 76a66253 j_mayer
    spr_register(env, SPR_401_SKR, "SKR",
2014 76a66253 j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2015 76a66253 j_mayer
                 &spr_read_generic, &spr_write_generic,
2016 76a66253 j_mayer
                 0x00000000);
2017 76a66253 j_mayer
}
2018 a750fc0b j_mayer
2019 a750fc0b j_mayer
#if defined (TARGET_PPC64)
2020 a750fc0b j_mayer
#if defined (TODO)
2021 a750fc0b j_mayer
/* SPR specific to PowerPC 620 */
2022 a750fc0b j_mayer
static void gen_spr_620 (CPUPPCState *env)
2023 a750fc0b j_mayer
{
2024 a750fc0b j_mayer
    spr_register(env, SPR_620_PMR0, "PMR0",
2025 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2026 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
2027 a750fc0b j_mayer
                 0x00000000);
2028 a750fc0b j_mayer
    spr_register(env, SPR_620_PMR1, "PMR1",
2029 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2030 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
2031 a750fc0b j_mayer
                 0x00000000);
2032 a750fc0b j_mayer
    spr_register(env, SPR_620_PMR2, "PMR2",
2033 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2034 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
2035 a750fc0b j_mayer
                 0x00000000);
2036 a750fc0b j_mayer
    spr_register(env, SPR_620_PMR3, "PMR3",
2037 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2038 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
2039 a750fc0b j_mayer
                 0x00000000);
2040 a750fc0b j_mayer
    spr_register(env, SPR_620_PMR4, "PMR4",
2041 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2042 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
2043 a750fc0b j_mayer
                 0x00000000);
2044 a750fc0b j_mayer
    spr_register(env, SPR_620_PMR5, "PMR5",
2045 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2046 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
2047 a750fc0b j_mayer
                 0x00000000);
2048 a750fc0b j_mayer
    spr_register(env, SPR_620_PMR6, "PMR6",
2049 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2050 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
2051 a750fc0b j_mayer
                 0x00000000);
2052 a750fc0b j_mayer
    spr_register(env, SPR_620_PMR7, "PMR7",
2053 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2054 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
2055 a750fc0b j_mayer
                 0x00000000);
2056 a750fc0b j_mayer
    spr_register(env, SPR_620_PMR8, "PMR8",
2057 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2058 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
2059 a750fc0b j_mayer
                 0x00000000);
2060 a750fc0b j_mayer
    spr_register(env, SPR_620_PMR9, "PMR9",
2061 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2062 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
2063 a750fc0b j_mayer
                 0x00000000);
2064 a750fc0b j_mayer
    spr_register(env, SPR_620_PMRA, "PMR10",
2065 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2066 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
2067 a750fc0b j_mayer
                 0x00000000);
2068 a750fc0b j_mayer
    spr_register(env, SPR_620_PMRB, "PMR11",
2069 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2070 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
2071 a750fc0b j_mayer
                 0x00000000);
2072 a750fc0b j_mayer
    spr_register(env, SPR_620_PMRC, "PMR12",
2073 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2074 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
2075 a750fc0b j_mayer
                 0x00000000);
2076 a750fc0b j_mayer
    spr_register(env, SPR_620_PMRD, "PMR13",
2077 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2078 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
2079 a750fc0b j_mayer
                 0x00000000);
2080 a750fc0b j_mayer
    spr_register(env, SPR_620_PMRE, "PMR14",
2081 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2082 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
2083 a750fc0b j_mayer
                 0x00000000);
2084 a750fc0b j_mayer
    spr_register(env, SPR_620_PMRF, "PMR15",
2085 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2086 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
2087 a750fc0b j_mayer
                 0x00000000);
2088 a750fc0b j_mayer
    spr_register(env, SPR_620_HID8, "HID8",
2089 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2090 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
2091 a750fc0b j_mayer
                 0x00000000);
2092 a750fc0b j_mayer
    spr_register(env, SPR_620_HID9, "HID9",
2093 a750fc0b j_mayer
                 SPR_NOACCESS, SPR_NOACCESS,
2094 a750fc0b j_mayer
                 &spr_read_generic, &spr_write_generic,
2095 a750fc0b j_mayer
                 0x00000000);
2096 a750fc0b j_mayer
}
2097 76a66253 j_mayer
#endif
2098 a750fc0b j_mayer
#endif /* defined (TARGET_PPC64) */
2099 76a66253 j_mayer
2100 2662a059 j_mayer
// XXX: TODO
2101 76a66253 j_mayer
/*
2102 2662a059 j_mayer
 * AMR     => SPR 29 (Power 2.04)
2103 2662a059 j_mayer
 * CTRL    => SPR 136 (Power 2.04)
2104 2662a059 j_mayer
 * CTRL    => SPR 152 (Power 2.04)
2105 2662a059 j_mayer
 * SCOMC   => SPR 276 (64 bits ?)
2106 2662a059 j_mayer
 * SCOMD   => SPR 277 (64 bits ?)
2107 2662a059 j_mayer
 * ASR     => SPR 280 (64 bits)
2108 2662a059 j_mayer
 * TBU40   => SPR 286 (Power 2.04 hypv)
2109 2662a059 j_mayer
 * HSPRG0  => SPR 304 (Power 2.04 hypv)
2110 2662a059 j_mayer
 * HSPRG1  => SPR 305 (Power 2.04 hypv)
2111 2662a059 j_mayer
 * HDSISR  => SPR 306 (Power 2.04 hypv)
2112 2662a059 j_mayer
 * HDAR    => SPR 307 (Power 2.04 hypv)
2113 2662a059 j_mayer
 * PURR    => SPR 309 (Power 2.04 hypv)
2114 2662a059 j_mayer
 * HDEC    => SPR 310 (Power 2.04 hypv)
2115 2662a059 j_mayer
 * HIOR    => SPR 311 (hypv)
2116 2662a059 j_mayer
 * RMOR    => SPR 312 (970)
2117 2662a059 j_mayer
 * HRMOR   => SPR 313 (Power 2.04 hypv)
2118 2662a059 j_mayer
 * HSRR0   => SPR 314 (Power 2.04 hypv)
2119 2662a059 j_mayer
 * HSRR1   => SPR 315 (Power 2.04 hypv)
2120 2662a059 j_mayer
 * LPCR    => SPR 316 (970)
2121 2662a059 j_mayer
 * LPIDR   => SPR 317 (970)
2122 2662a059 j_mayer
 * SPEFSCR => SPR 512 (Power 2.04 emb)
2123 2662a059 j_mayer
 * ATBL    => SPR 526 (Power 2.04 emb)
2124 2662a059 j_mayer
 * ATBU    => SPR 527 (Power 2.04 emb)
2125 2662a059 j_mayer
 * EPR     => SPR 702 (Power 2.04 emb)
2126 2662a059 j_mayer
 * perf    => 768-783 (Power 2.04)
2127 2662a059 j_mayer
 * perf    => 784-799 (Power 2.04)
2128 2662a059 j_mayer
 * PPR     => SPR 896 (Power 2.04)
2129 2662a059 j_mayer
 * EPLC    => SPR 947 (Power 2.04 emb)
2130 2662a059 j_mayer
 * EPSC    => SPR 948 (Power 2.04 emb)
2131 2662a059 j_mayer
 * DABRX   => 1015    (Power 2.04 hypv)
2132 2662a059 j_mayer
 * FPECR   => SPR 1022 (?)
2133 76a66253 j_mayer
 * ... and more (thermal management, performance counters, ...)
2134 76a66253 j_mayer
 */
2135 76a66253 j_mayer
2136 a750fc0b j_mayer
/*****************************************************************************/
2137 e1833e1f j_mayer
/* Exception vectors models                                                  */
2138 e1833e1f j_mayer
static void init_excp_4xx_real (CPUPPCState *env)
2139 e1833e1f j_mayer
{
2140 e1833e1f j_mayer
#if !defined(CONFIG_USER_ONLY)
2141 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_CRITICAL] = 0x00000100;
2142 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_MCHECK]   = 0x00000200;
2143 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
2144 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_ALIGN]    = 0x00000600;
2145 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_PROGRAM]  = 0x00000700;
2146 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_SYSCALL]  = 0x00000C00;
2147 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_PIT]      = 0x00001000;
2148 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_FIT]      = 0x00001010;
2149 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_WDT]      = 0x00001020;
2150 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DEBUG]    = 0x00002000;
2151 e1833e1f j_mayer
#endif
2152 e1833e1f j_mayer
}
2153 e1833e1f j_mayer
2154 e1833e1f j_mayer
static void init_excp_4xx_softmmu (CPUPPCState *env)
2155 e1833e1f j_mayer
{
2156 e1833e1f j_mayer
#if !defined(CONFIG_USER_ONLY)
2157 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_CRITICAL] = 0x00000100;
2158 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_MCHECK]   = 0x00000200;
2159 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DSI]      = 0x00000300;
2160 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_ISI]      = 0x00000400;
2161 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
2162 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_ALIGN]    = 0x00000600;
2163 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_PROGRAM]  = 0x00000700;
2164 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_SYSCALL]  = 0x00000C00;
2165 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_PIT]      = 0x00001000;
2166 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_FIT]      = 0x00001010;
2167 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_WDT]      = 0x00001020;
2168 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DTLB]     = 0x00001100;
2169 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_ITLB]     = 0x00001200;
2170 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DEBUG]    = 0x00002000;
2171 e1833e1f j_mayer
#endif
2172 e1833e1f j_mayer
}
2173 e1833e1f j_mayer
2174 e1833e1f j_mayer
static void init_excp_BookE (CPUPPCState *env)
2175 e1833e1f j_mayer
{
2176 e1833e1f j_mayer
#if !defined(CONFIG_USER_ONLY)
2177 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_CRITICAL] = 0x00000000;
2178 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_MCHECK]   = 0x00000000;
2179 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DSI]      = 0x00000000;
2180 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_ISI]      = 0x00000000;
2181 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000000;
2182 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_ALIGN]    = 0x00000000;
2183 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_PROGRAM]  = 0x00000000;
2184 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_FPU]      = 0x00000000;
2185 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_SYSCALL]  = 0x00000000;
2186 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_APU]      = 0x00000000;
2187 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DECR]     = 0x00000000;
2188 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_FIT]      = 0x00000000;
2189 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_WDT]      = 0x00000000;
2190 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DTLB]     = 0x00000000;
2191 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_ITLB]     = 0x00000000;
2192 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DEBUG]    = 0x00000000;
2193 e1833e1f j_mayer
    env->excp_prefix = 0x00000000;
2194 e1833e1f j_mayer
    env->ivor_mask = 0x0000FFE0;
2195 e1833e1f j_mayer
    env->ivpr_mask = 0xFFFF0000;
2196 e1833e1f j_mayer
#endif
2197 e1833e1f j_mayer
}
2198 e1833e1f j_mayer
2199 e1833e1f j_mayer
static void init_excp_601 (CPUPPCState *env)
2200 e1833e1f j_mayer
{
2201 e1833e1f j_mayer
#if !defined(CONFIG_USER_ONLY)
2202 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_RESET]    = 0x00000100;
2203 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_MCHECK]   = 0x00000200;
2204 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DSI]      = 0x00000300;
2205 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_ISI]      = 0x00000400;
2206 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
2207 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_ALIGN]    = 0x00000600;
2208 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_PROGRAM]  = 0x00000700;
2209 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_FPU]      = 0x00000800;
2210 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DECR]     = 0x00000900;
2211 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_IO]       = 0x00000A00;
2212 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_SYSCALL]  = 0x00000C00;
2213 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_RUNM]     = 0x00002000;
2214 e1833e1f j_mayer
    env->excp_prefix = 0xFFF00000;
2215 e1833e1f j_mayer
#endif
2216 e1833e1f j_mayer
}
2217 e1833e1f j_mayer
2218 e1833e1f j_mayer
static void init_excp_602 (CPUPPCState *env)
2219 e1833e1f j_mayer
{
2220 e1833e1f j_mayer
#if !defined(CONFIG_USER_ONLY)
2221 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_RESET]    = 0x00000100;
2222 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_MCHECK]   = 0x00000200;
2223 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DSI]      = 0x00000300;
2224 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_ISI]      = 0x00000400;
2225 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
2226 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_ALIGN]    = 0x00000600;
2227 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_PROGRAM]  = 0x00000700;
2228 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_FPU]      = 0x00000800;
2229 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DECR]     = 0x00000900;
2230 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_SYSCALL]  = 0x00000C00;
2231 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_TRACE]    = 0x00000D00;
2232 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_FPA]      = 0x00000E00;
2233 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_IFTLB]    = 0x00001000;
2234 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DLTLB]    = 0x00001100;
2235 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DSTLB]    = 0x00001200;
2236 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_IABR]     = 0x00001300;
2237 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_SMI]      = 0x00001400;
2238 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_WDT]      = 0x00001500;
2239 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_EMUL]     = 0x00001600;
2240 e1833e1f j_mayer
    env->excp_prefix = 0xFFF00000;
2241 e1833e1f j_mayer
#endif
2242 e1833e1f j_mayer
}
2243 e1833e1f j_mayer
2244 e1833e1f j_mayer
static void init_excp_603 (CPUPPCState *env)
2245 e1833e1f j_mayer
{
2246 e1833e1f j_mayer
#if !defined(CONFIG_USER_ONLY)
2247 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_RESET]    = 0x00000100;
2248 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_MCHECK]   = 0x00000200;
2249 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DSI]      = 0x00000300;
2250 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_ISI]      = 0x00000400;
2251 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
2252 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_ALIGN]    = 0x00000600;
2253 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_PROGRAM]  = 0x00000700;
2254 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_FPU]      = 0x00000800;
2255 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DECR]     = 0x00000900;
2256 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_SYSCALL]  = 0x00000C00;
2257 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_TRACE]    = 0x00000D00;
2258 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_IFTLB]    = 0x00001000;
2259 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DLTLB]    = 0x00001100;
2260 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DSTLB]    = 0x00001200;
2261 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_IABR]     = 0x00001300;
2262 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_SMI]      = 0x00001400;
2263 e1833e1f j_mayer
#endif
2264 e1833e1f j_mayer
}
2265 e1833e1f j_mayer
2266 e1833e1f j_mayer
static void init_excp_G2 (CPUPPCState *env)
2267 e1833e1f j_mayer
{
2268 e1833e1f j_mayer
#if !defined(CONFIG_USER_ONLY)
2269 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_RESET]    = 0x00000100;
2270 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_MCHECK]   = 0x00000200;
2271 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DSI]      = 0x00000300;
2272 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_ISI]      = 0x00000400;
2273 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
2274 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_ALIGN]    = 0x00000600;
2275 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_PROGRAM]  = 0x00000700;
2276 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_FPU]      = 0x00000800;
2277 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DECR]     = 0x00000900;
2278 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_CRITICAL] = 0x00000A00;
2279 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_SYSCALL]  = 0x00000C00;
2280 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_TRACE]    = 0x00000D00;
2281 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_IFTLB]    = 0x00001000;
2282 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DLTLB]    = 0x00001100;
2283 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DSTLB]    = 0x00001200;
2284 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_IABR]     = 0x00001300;
2285 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_SMI]      = 0x00001400;
2286 e1833e1f j_mayer
#endif
2287 e1833e1f j_mayer
}
2288 e1833e1f j_mayer
2289 e1833e1f j_mayer
static void init_excp_604 (CPUPPCState *env)
2290 e1833e1f j_mayer
{
2291 e1833e1f j_mayer
#if !defined(CONFIG_USER_ONLY)
2292 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_RESET]    = 0x00000100;
2293 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_MCHECK]   = 0x00000200;
2294 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_DSI]      = 0x00000300;
2295 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_ISI]      = 0x00000400;
2296 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500;
2297 e1833e1f j_mayer
    env->excp_vectors[POWERPC_EXCP_ALIGN]    = 0x00000600;
2298 e1833e1f j_mayer
    env->excp_vectors[PO