2 * PowerPC CPU initialization for qemu.
4 * Copyright (c) 2003-2007 Jocelyn Mayer
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 /* A lot of PowerPC definition have been included here.
22 * Most of them are not usable for now but have been kept
23 * inside "#if defined(TODO) ... #endif" statements to make tests easier.
26 //#define PPC_DUMP_CPU
27 //#define PPC_DEBUG_SPR
28 //#define PPC_DEBUG_IRQ
31 const unsigned char *name
;
39 /* For user-mode emulation, we don't emulate any IRQ controller */
40 #if defined(CONFIG_USER_ONLY)
41 #define PPC_IRQ_INIT_FN(name) \
42 static inline void glue(glue(ppc, name),_irq_init) (CPUPPCState *env) \
46 #define PPC_IRQ_INIT_FN(name) \
47 void glue(glue(ppc, name),_irq_init) (CPUPPCState *env);
54 * do nothing but store/retrieve spr value
56 #ifdef PPC_DUMP_SPR_ACCESSES
57 static void spr_read_generic (void *opaque
, int sprn
)
59 gen_op_load_dump_spr(sprn
);
62 static void spr_write_generic (void *opaque
, int sprn
)
64 gen_op_store_dump_spr(sprn
);
67 static void spr_read_generic (void *opaque
, int sprn
)
69 gen_op_load_spr(sprn
);
72 static void spr_write_generic (void *opaque
, int sprn
)
74 gen_op_store_spr(sprn
);
78 #if !defined(CONFIG_USER_ONLY)
79 static void spr_write_clear (void *opaque
, int sprn
)
81 gen_op_mask_spr(sprn
);
85 /* SPR common to all PowerPC */
87 static void spr_read_xer (void *opaque
, int sprn
)
92 static void spr_write_xer (void *opaque
, int sprn
)
98 static void spr_read_lr (void *opaque
, int sprn
)
103 static void spr_write_lr (void *opaque
, int sprn
)
109 static void spr_read_ctr (void *opaque
, int sprn
)
114 static void spr_write_ctr (void *opaque
, int sprn
)
119 /* User read access to SPR */
125 static void spr_read_ureg (void *opaque
, int sprn
)
127 gen_op_load_spr(sprn
+ 0x10);
130 /* SPR common to all non-embedded PowerPC */
132 #if !defined(CONFIG_USER_ONLY)
133 static void spr_read_decr (void *opaque
, int sprn
)
138 static void spr_write_decr (void *opaque
, int sprn
)
144 /* SPR common to all non-embedded PowerPC, except 601 */
146 static void spr_read_tbl (void *opaque
, int sprn
)
151 static void spr_read_tbu (void *opaque
, int sprn
)
156 #if !defined(CONFIG_USER_ONLY)
157 static void spr_write_tbl (void *opaque
, int sprn
)
162 static void spr_write_tbu (void *opaque
, int sprn
)
168 #if !defined(CONFIG_USER_ONLY)
169 /* IBAT0U...IBAT0U */
170 /* IBAT0L...IBAT7L */
171 static void spr_read_ibat (void *opaque
, int sprn
)
173 gen_op_load_ibat(sprn
& 1, (sprn
- SPR_IBAT0U
) / 2);
176 static void spr_read_ibat_h (void *opaque
, int sprn
)
178 gen_op_load_ibat(sprn
& 1, (sprn
- SPR_IBAT4U
) / 2);
181 static void spr_write_ibatu (void *opaque
, int sprn
)
183 DisasContext
*ctx
= opaque
;
185 gen_op_store_ibatu((sprn
- SPR_IBAT0U
) / 2);
189 static void spr_write_ibatu_h (void *opaque
, int sprn
)
191 DisasContext
*ctx
= opaque
;
193 gen_op_store_ibatu((sprn
- SPR_IBAT4U
) / 2);
197 static void spr_write_ibatl (void *opaque
, int sprn
)
199 DisasContext
*ctx
= opaque
;
201 gen_op_store_ibatl((sprn
- SPR_IBAT0L
) / 2);
205 static void spr_write_ibatl_h (void *opaque
, int sprn
)
207 DisasContext
*ctx
= opaque
;
209 gen_op_store_ibatl((sprn
- SPR_IBAT4L
) / 2);
213 /* DBAT0U...DBAT7U */
214 /* DBAT0L...DBAT7L */
215 static void spr_read_dbat (void *opaque
, int sprn
)
217 gen_op_load_dbat(sprn
& 1, (sprn
- SPR_DBAT0U
) / 2);
220 static void spr_read_dbat_h (void *opaque
, int sprn
)
222 gen_op_load_dbat(sprn
& 1, (sprn
- SPR_DBAT4U
) / 2);
225 static void spr_write_dbatu (void *opaque
, int sprn
)
227 DisasContext
*ctx
= opaque
;
229 gen_op_store_dbatu((sprn
- SPR_DBAT0U
) / 2);
233 static void spr_write_dbatu_h (void *opaque
, int sprn
)
235 DisasContext
*ctx
= opaque
;
237 gen_op_store_dbatu((sprn
- SPR_DBAT4U
) / 2);
241 static void spr_write_dbatl (void *opaque
, int sprn
)
243 DisasContext
*ctx
= opaque
;
245 gen_op_store_dbatl((sprn
- SPR_DBAT0L
) / 2);
249 static void spr_write_dbatl_h (void *opaque
, int sprn
)
251 DisasContext
*ctx
= opaque
;
253 gen_op_store_dbatl((sprn
- SPR_DBAT4L
) / 2);
258 static void spr_read_sdr1 (void *opaque
, int sprn
)
263 static void spr_write_sdr1 (void *opaque
, int sprn
)
265 DisasContext
*ctx
= opaque
;
271 /* 64 bits PowerPC specific SPRs */
273 /* Currently unused */
274 #if 0 && defined(TARGET_PPC64)
275 static void spr_read_asr (void *opaque
, int sprn
)
280 static void spr_write_asr (void *opaque
, int sprn
)
282 DisasContext
*ctx
= opaque
;
288 #endif /* !defined(CONFIG_USER_ONLY) */
290 /* PowerPC 601 specific registers */
292 static void spr_read_601_rtcl (void *opaque
, int sprn
)
294 gen_op_load_601_rtcl();
297 static void spr_read_601_rtcu (void *opaque
, int sprn
)
299 gen_op_load_601_rtcu();
302 #if !defined(CONFIG_USER_ONLY)
303 static void spr_write_601_rtcu (void *opaque
, int sprn
)
305 gen_op_store_601_rtcu();
308 static void spr_write_601_rtcl (void *opaque
, int sprn
)
310 gen_op_store_601_rtcl();
315 #if !defined(CONFIG_USER_ONLY)
316 static void spr_read_601_ubat (void *opaque
, int sprn
)
318 gen_op_load_601_bat(sprn
& 1, (sprn
- SPR_IBAT0U
) / 2);
321 static void spr_write_601_ubatu (void *opaque
, int sprn
)
323 DisasContext
*ctx
= opaque
;
325 gen_op_store_601_batu((sprn
- SPR_IBAT0U
) / 2);
329 static void spr_write_601_ubatl (void *opaque
, int sprn
)
331 DisasContext
*ctx
= opaque
;
333 gen_op_store_601_batl((sprn
- SPR_IBAT0L
) / 2);
338 /* PowerPC 40x specific registers */
339 #if !defined(CONFIG_USER_ONLY)
340 static void spr_read_40x_pit (void *opaque
, int sprn
)
342 gen_op_load_40x_pit();
345 static void spr_write_40x_pit (void *opaque
, int sprn
)
347 gen_op_store_40x_pit();
350 static void spr_write_40x_dbcr0 (void *opaque
, int sprn
)
352 DisasContext
*ctx
= opaque
;
354 gen_op_store_40x_dbcr0();
355 /* We must stop translation as we may have rebooted */
359 static void spr_write_40x_sler (void *opaque
, int sprn
)
361 DisasContext
*ctx
= opaque
;
363 gen_op_store_40x_sler();
364 /* We must stop the translation as we may have changed
365 * some regions endianness
370 static void spr_write_booke_tcr (void *opaque
, int sprn
)
372 gen_op_store_booke_tcr();
375 static void spr_write_booke_tsr (void *opaque
, int sprn
)
377 gen_op_store_booke_tsr();
381 /* PowerPC 403 specific registers */
382 /* PBL1 / PBU1 / PBL2 / PBU2 */
383 #if !defined(CONFIG_USER_ONLY)
384 static void spr_read_403_pbr (void *opaque
, int sprn
)
386 gen_op_load_403_pb(sprn
- SPR_403_PBL1
);
389 static void spr_write_403_pbr (void *opaque
, int sprn
)
391 DisasContext
*ctx
= opaque
;
393 gen_op_store_403_pb(sprn
- SPR_403_PBL1
);
397 static void spr_write_pir (void *opaque
, int sprn
)
403 #if defined(CONFIG_USER_ONLY)
404 #define spr_register(env, num, name, uea_read, uea_write, \
405 oea_read, oea_write, initial_value) \
407 _spr_register(env, num, name, uea_read, uea_write, initial_value); \
409 static inline void _spr_register (CPUPPCState
*env
, int num
,
410 const unsigned char *name
,
411 void (*uea_read
)(void *opaque
, int sprn
),
412 void (*uea_write
)(void *opaque
, int sprn
),
413 target_ulong initial_value
)
415 static inline void spr_register (CPUPPCState
*env
, int num
,
416 const unsigned char *name
,
417 void (*uea_read
)(void *opaque
, int sprn
),
418 void (*uea_write
)(void *opaque
, int sprn
),
419 void (*oea_read
)(void *opaque
, int sprn
),
420 void (*oea_write
)(void *opaque
, int sprn
),
421 target_ulong initial_value
)
426 spr
= &env
->spr_cb
[num
];
427 if (spr
->name
!= NULL
||env
-> spr
[num
] != 0x00000000 ||
428 #if !defined(CONFIG_USER_ONLY)
429 spr
->oea_read
!= NULL
|| spr
->oea_write
!= NULL
||
431 spr
->uea_read
!= NULL
|| spr
->uea_write
!= NULL
) {
432 printf("Error: Trying to register SPR %d (%03x) twice !\n", num
, num
);
435 #if defined(PPC_DEBUG_SPR)
436 printf("*** register spr %d (%03x) %s val " ADDRX
"\n", num
, num
, name
,
440 spr
->uea_read
= uea_read
;
441 spr
->uea_write
= uea_write
;
442 #if !defined(CONFIG_USER_ONLY)
443 spr
->oea_read
= oea_read
;
444 spr
->oea_write
= oea_write
;
446 env
->spr
[num
] = initial_value
;
449 /* Generic PowerPC SPRs */
450 static void gen_spr_generic (CPUPPCState
*env
)
452 /* Integer processing */
453 spr_register(env
, SPR_XER
, "XER",
454 &spr_read_xer
, &spr_write_xer
,
455 &spr_read_xer
, &spr_write_xer
,
458 spr_register(env
, SPR_LR
, "LR",
459 &spr_read_lr
, &spr_write_lr
,
460 &spr_read_lr
, &spr_write_lr
,
462 spr_register(env
, SPR_CTR
, "CTR",
463 &spr_read_ctr
, &spr_write_ctr
,
464 &spr_read_ctr
, &spr_write_ctr
,
466 /* Interrupt processing */
467 spr_register(env
, SPR_SRR0
, "SRR0",
468 SPR_NOACCESS
, SPR_NOACCESS
,
469 &spr_read_generic
, &spr_write_generic
,
471 spr_register(env
, SPR_SRR1
, "SRR1",
472 SPR_NOACCESS
, SPR_NOACCESS
,
473 &spr_read_generic
, &spr_write_generic
,
475 /* Processor control */
476 spr_register(env
, SPR_SPRG0
, "SPRG0",
477 SPR_NOACCESS
, SPR_NOACCESS
,
478 &spr_read_generic
, &spr_write_generic
,
480 spr_register(env
, SPR_SPRG1
, "SPRG1",
481 SPR_NOACCESS
, SPR_NOACCESS
,
482 &spr_read_generic
, &spr_write_generic
,
484 spr_register(env
, SPR_SPRG2
, "SPRG2",
485 SPR_NOACCESS
, SPR_NOACCESS
,
486 &spr_read_generic
, &spr_write_generic
,
488 spr_register(env
, SPR_SPRG3
, "SPRG3",
489 SPR_NOACCESS
, SPR_NOACCESS
,
490 &spr_read_generic
, &spr_write_generic
,
494 /* SPR common to all non-embedded PowerPC, including 601 */
495 static void gen_spr_ne_601 (CPUPPCState
*env
)
497 /* Exception processing */
498 spr_register(env
, SPR_DSISR
, "DSISR",
499 SPR_NOACCESS
, SPR_NOACCESS
,
500 &spr_read_generic
, &spr_write_generic
,
502 spr_register(env
, SPR_DAR
, "DAR",
503 SPR_NOACCESS
, SPR_NOACCESS
,
504 &spr_read_generic
, &spr_write_generic
,
507 spr_register(env
, SPR_DECR
, "DECR",
508 SPR_NOACCESS
, SPR_NOACCESS
,
509 &spr_read_decr
, &spr_write_decr
,
511 /* Memory management */
512 spr_register(env
, SPR_SDR1
, "SDR1",
513 SPR_NOACCESS
, SPR_NOACCESS
,
514 &spr_read_sdr1
, &spr_write_sdr1
,
519 static void gen_low_BATs (CPUPPCState
*env
)
521 spr_register(env
, SPR_IBAT0U
, "IBAT0U",
522 SPR_NOACCESS
, SPR_NOACCESS
,
523 &spr_read_ibat
, &spr_write_ibatu
,
525 spr_register(env
, SPR_IBAT0L
, "IBAT0L",
526 SPR_NOACCESS
, SPR_NOACCESS
,
527 &spr_read_ibat
, &spr_write_ibatl
,
529 spr_register(env
, SPR_IBAT1U
, "IBAT1U",
530 SPR_NOACCESS
, SPR_NOACCESS
,
531 &spr_read_ibat
, &spr_write_ibatu
,
533 spr_register(env
, SPR_IBAT1L
, "IBAT1L",
534 SPR_NOACCESS
, SPR_NOACCESS
,
535 &spr_read_ibat
, &spr_write_ibatl
,
537 spr_register(env
, SPR_IBAT2U
, "IBAT2U",
538 SPR_NOACCESS
, SPR_NOACCESS
,
539 &spr_read_ibat
, &spr_write_ibatu
,
541 spr_register(env
, SPR_IBAT2L
, "IBAT2L",
542 SPR_NOACCESS
, SPR_NOACCESS
,
543 &spr_read_ibat
, &spr_write_ibatl
,
545 spr_register(env
, SPR_IBAT3U
, "IBAT3U",
546 SPR_NOACCESS
, SPR_NOACCESS
,
547 &spr_read_ibat
, &spr_write_ibatu
,
549 spr_register(env
, SPR_IBAT3L
, "IBAT3L",
550 SPR_NOACCESS
, SPR_NOACCESS
,
551 &spr_read_ibat
, &spr_write_ibatl
,
553 spr_register(env
, SPR_DBAT0U
, "DBAT0U",
554 SPR_NOACCESS
, SPR_NOACCESS
,
555 &spr_read_dbat
, &spr_write_dbatu
,
557 spr_register(env
, SPR_DBAT0L
, "DBAT0L",
558 SPR_NOACCESS
, SPR_NOACCESS
,
559 &spr_read_dbat
, &spr_write_dbatl
,
561 spr_register(env
, SPR_DBAT1U
, "DBAT1U",
562 SPR_NOACCESS
, SPR_NOACCESS
,
563 &spr_read_dbat
, &spr_write_dbatu
,
565 spr_register(env
, SPR_DBAT1L
, "DBAT1L",
566 SPR_NOACCESS
, SPR_NOACCESS
,
567 &spr_read_dbat
, &spr_write_dbatl
,
569 spr_register(env
, SPR_DBAT2U
, "DBAT2U",
570 SPR_NOACCESS
, SPR_NOACCESS
,
571 &spr_read_dbat
, &spr_write_dbatu
,
573 spr_register(env
, SPR_DBAT2L
, "DBAT2L",
574 SPR_NOACCESS
, SPR_NOACCESS
,
575 &spr_read_dbat
, &spr_write_dbatl
,
577 spr_register(env
, SPR_DBAT3U
, "DBAT3U",
578 SPR_NOACCESS
, SPR_NOACCESS
,
579 &spr_read_dbat
, &spr_write_dbatu
,
581 spr_register(env
, SPR_DBAT3L
, "DBAT3L",
582 SPR_NOACCESS
, SPR_NOACCESS
,
583 &spr_read_dbat
, &spr_write_dbatl
,
589 static void gen_high_BATs (CPUPPCState
*env
)
591 spr_register(env
, SPR_IBAT4U
, "IBAT4U",
592 SPR_NOACCESS
, SPR_NOACCESS
,
593 &spr_read_ibat_h
, &spr_write_ibatu_h
,
595 spr_register(env
, SPR_IBAT4L
, "IBAT4L",
596 SPR_NOACCESS
, SPR_NOACCESS
,
597 &spr_read_ibat_h
, &spr_write_ibatl_h
,
599 spr_register(env
, SPR_IBAT5U
, "IBAT5U",
600 SPR_NOACCESS
, SPR_NOACCESS
,
601 &spr_read_ibat_h
, &spr_write_ibatu_h
,
603 spr_register(env
, SPR_IBAT5L
, "IBAT5L",
604 SPR_NOACCESS
, SPR_NOACCESS
,
605 &spr_read_ibat_h
, &spr_write_ibatl_h
,
607 spr_register(env
, SPR_IBAT6U
, "IBAT6U",
608 SPR_NOACCESS
, SPR_NOACCESS
,
609 &spr_read_ibat_h
, &spr_write_ibatu_h
,
611 spr_register(env
, SPR_IBAT6L
, "IBAT6L",
612 SPR_NOACCESS
, SPR_NOACCESS
,
613 &spr_read_ibat_h
, &spr_write_ibatl_h
,
615 spr_register(env
, SPR_IBAT7U
, "IBAT7U",
616 SPR_NOACCESS
, SPR_NOACCESS
,
617 &spr_read_ibat_h
, &spr_write_ibatu_h
,
619 spr_register(env
, SPR_IBAT7L
, "IBAT7L",
620 SPR_NOACCESS
, SPR_NOACCESS
,
621 &spr_read_ibat_h
, &spr_write_ibatl_h
,
623 spr_register(env
, SPR_DBAT4U
, "DBAT4U",
624 SPR_NOACCESS
, SPR_NOACCESS
,
625 &spr_read_dbat_h
, &spr_write_dbatu_h
,
627 spr_register(env
, SPR_DBAT4L
, "DBAT4L",
628 SPR_NOACCESS
, SPR_NOACCESS
,
629 &spr_read_dbat_h
, &spr_write_dbatl_h
,
631 spr_register(env
, SPR_DBAT5U
, "DBAT5U",
632 SPR_NOACCESS
, SPR_NOACCESS
,
633 &spr_read_dbat_h
, &spr_write_dbatu_h
,
635 spr_register(env
, SPR_DBAT5L
, "DBAT5L",
636 SPR_NOACCESS
, SPR_NOACCESS
,
637 &spr_read_dbat_h
, &spr_write_dbatl_h
,
639 spr_register(env
, SPR_DBAT6U
, "DBAT6U",
640 SPR_NOACCESS
, SPR_NOACCESS
,
641 &spr_read_dbat_h
, &spr_write_dbatu_h
,
643 spr_register(env
, SPR_DBAT6L
, "DBAT6L",
644 SPR_NOACCESS
, SPR_NOACCESS
,
645 &spr_read_dbat_h
, &spr_write_dbatl_h
,
647 spr_register(env
, SPR_DBAT7U
, "DBAT7U",
648 SPR_NOACCESS
, SPR_NOACCESS
,
649 &spr_read_dbat_h
, &spr_write_dbatu_h
,
651 spr_register(env
, SPR_DBAT7L
, "DBAT7L",
652 SPR_NOACCESS
, SPR_NOACCESS
,
653 &spr_read_dbat_h
, &spr_write_dbatl_h
,
658 /* Generic PowerPC time base */
659 static void gen_tbl (CPUPPCState
*env
)
661 spr_register(env
, SPR_VTBL
, "TBL",
662 &spr_read_tbl
, SPR_NOACCESS
,
663 &spr_read_tbl
, SPR_NOACCESS
,
665 spr_register(env
, SPR_TBL
, "TBL",
666 SPR_NOACCESS
, SPR_NOACCESS
,
667 SPR_NOACCESS
, &spr_write_tbl
,
669 spr_register(env
, SPR_VTBU
, "TBU",
670 &spr_read_tbu
, SPR_NOACCESS
,
671 &spr_read_tbu
, SPR_NOACCESS
,
673 spr_register(env
, SPR_TBU
, "TBU",
674 SPR_NOACCESS
, SPR_NOACCESS
,
675 SPR_NOACCESS
, &spr_write_tbu
,
679 /* Softare table search registers */
680 static void gen_6xx_7xx_soft_tlb (CPUPPCState
*env
, int nb_tlbs
, int nb_ways
)
682 env
->nb_tlb
= nb_tlbs
;
683 env
->nb_ways
= nb_ways
;
685 spr_register(env
, SPR_DMISS
, "DMISS",
686 SPR_NOACCESS
, SPR_NOACCESS
,
687 &spr_read_generic
, SPR_NOACCESS
,
689 spr_register(env
, SPR_DCMP
, "DCMP",
690 SPR_NOACCESS
, SPR_NOACCESS
,
691 &spr_read_generic
, SPR_NOACCESS
,
693 spr_register(env
, SPR_HASH1
, "HASH1",
694 SPR_NOACCESS
, SPR_NOACCESS
,
695 &spr_read_generic
, SPR_NOACCESS
,
697 spr_register(env
, SPR_HASH2
, "HASH2",
698 SPR_NOACCESS
, SPR_NOACCESS
,
699 &spr_read_generic
, SPR_NOACCESS
,
701 spr_register(env
, SPR_IMISS
, "IMISS",
702 SPR_NOACCESS
, SPR_NOACCESS
,
703 &spr_read_generic
, SPR_NOACCESS
,
705 spr_register(env
, SPR_ICMP
, "ICMP",
706 SPR_NOACCESS
, SPR_NOACCESS
,
707 &spr_read_generic
, SPR_NOACCESS
,
709 spr_register(env
, SPR_RPA
, "RPA",
710 SPR_NOACCESS
, SPR_NOACCESS
,
711 &spr_read_generic
, &spr_write_generic
,
715 /* SPR common to MPC755 and G2 */
716 static void gen_spr_G2_755 (CPUPPCState
*env
)
719 spr_register(env
, SPR_SPRG4
, "SPRG4",
720 SPR_NOACCESS
, SPR_NOACCESS
,
721 &spr_read_generic
, &spr_write_generic
,
723 spr_register(env
, SPR_SPRG5
, "SPRG5",
724 SPR_NOACCESS
, SPR_NOACCESS
,
725 &spr_read_generic
, &spr_write_generic
,
727 spr_register(env
, SPR_SPRG6
, "SPRG6",
728 SPR_NOACCESS
, SPR_NOACCESS
,
729 &spr_read_generic
, &spr_write_generic
,
731 spr_register(env
, SPR_SPRG7
, "SPRG7",
732 SPR_NOACCESS
, SPR_NOACCESS
,
733 &spr_read_generic
, &spr_write_generic
,
735 /* External access control */
736 /* XXX : not implemented */
737 spr_register(env
, SPR_EAR
, "EAR",
738 SPR_NOACCESS
, SPR_NOACCESS
,
739 &spr_read_generic
, &spr_write_generic
,
743 /* SPR common to all 7xx PowerPC implementations */
744 static void gen_spr_7xx (CPUPPCState
*env
)
747 /* XXX : not implemented */
748 spr_register(env
, SPR_DABR
, "DABR",
749 SPR_NOACCESS
, SPR_NOACCESS
,
750 &spr_read_generic
, &spr_write_generic
,
752 /* XXX : not implemented */
753 spr_register(env
, SPR_IABR
, "IABR",
754 SPR_NOACCESS
, SPR_NOACCESS
,
755 &spr_read_generic
, &spr_write_generic
,
757 /* Cache management */
758 /* XXX : not implemented */
759 spr_register(env
, SPR_ICTC
, "ICTC",
760 SPR_NOACCESS
, SPR_NOACCESS
,
761 &spr_read_generic
, &spr_write_generic
,
763 /* XXX : not implemented */
764 spr_register(env
, SPR_L2CR
, "L2CR",
765 SPR_NOACCESS
, SPR_NOACCESS
,
766 &spr_read_generic
, &spr_write_generic
,
768 /* Performance monitors */
769 /* XXX : not implemented */
770 spr_register(env
, SPR_MMCR0
, "MMCR0",
771 SPR_NOACCESS
, SPR_NOACCESS
,
772 &spr_read_generic
, &spr_write_generic
,
774 /* XXX : not implemented */
775 spr_register(env
, SPR_MMCR1
, "MMCR1",
776 SPR_NOACCESS
, SPR_NOACCESS
,
777 &spr_read_generic
, &spr_write_generic
,
779 /* XXX : not implemented */
780 spr_register(env
, SPR_PMC1
, "PMC1",
781 SPR_NOACCESS
, SPR_NOACCESS
,
782 &spr_read_generic
, &spr_write_generic
,
784 /* XXX : not implemented */
785 spr_register(env
, SPR_PMC2
, "PMC2",
786 SPR_NOACCESS
, SPR_NOACCESS
,
787 &spr_read_generic
, &spr_write_generic
,
789 /* XXX : not implemented */
790 spr_register(env
, SPR_PMC3
, "PMC3",
791 SPR_NOACCESS
, SPR_NOACCESS
,
792 &spr_read_generic
, &spr_write_generic
,
794 /* XXX : not implemented */
795 spr_register(env
, SPR_PMC4
, "PMC4",
796 SPR_NOACCESS
, SPR_NOACCESS
,
797 &spr_read_generic
, &spr_write_generic
,
799 /* XXX : not implemented */
800 spr_register(env
, SPR_SIA
, "SIA",
801 SPR_NOACCESS
, SPR_NOACCESS
,
802 &spr_read_generic
, SPR_NOACCESS
,
804 spr_register(env
, SPR_UMMCR0
, "UMMCR0",
805 &spr_read_ureg
, SPR_NOACCESS
,
806 &spr_read_ureg
, SPR_NOACCESS
,
808 spr_register(env
, SPR_UMMCR1
, "UMMCR1",
809 &spr_read_ureg
, SPR_NOACCESS
,
810 &spr_read_ureg
, SPR_NOACCESS
,
812 spr_register(env
, SPR_UPMC1
, "UPMC1",
813 &spr_read_ureg
, SPR_NOACCESS
,
814 &spr_read_ureg
, SPR_NOACCESS
,
816 spr_register(env
, SPR_UPMC2
, "UPMC2",
817 &spr_read_ureg
, SPR_NOACCESS
,
818 &spr_read_ureg
, SPR_NOACCESS
,
820 spr_register(env
, SPR_UPMC3
, "UPMC3",
821 &spr_read_ureg
, SPR_NOACCESS
,
822 &spr_read_ureg
, SPR_NOACCESS
,
824 spr_register(env
, SPR_UPMC4
, "UPMC4",
825 &spr_read_ureg
, SPR_NOACCESS
,
826 &spr_read_ureg
, SPR_NOACCESS
,
828 spr_register(env
, SPR_USIA
, "USIA",
829 &spr_read_ureg
, SPR_NOACCESS
,
830 &spr_read_ureg
, SPR_NOACCESS
,
832 /* Thermal management */
833 /* XXX : not implemented */
834 spr_register(env
, SPR_THRM1
, "THRM1",
835 SPR_NOACCESS
, SPR_NOACCESS
,
836 &spr_read_generic
, &spr_write_generic
,
838 /* XXX : not implemented */
839 spr_register(env
, SPR_THRM2
, "THRM2",
840 SPR_NOACCESS
, SPR_NOACCESS
,
841 &spr_read_generic
, &spr_write_generic
,
843 /* XXX : not implemented */
844 spr_register(env
, SPR_THRM3
, "THRM3",
845 SPR_NOACCESS
, SPR_NOACCESS
,
846 &spr_read_generic
, &spr_write_generic
,
848 /* External access control */
849 /* XXX : not implemented */
850 spr_register(env
, SPR_EAR
, "EAR",
851 SPR_NOACCESS
, SPR_NOACCESS
,
852 &spr_read_generic
, &spr_write_generic
,
856 /* SPR specific to PowerPC 604 implementation */
857 static void gen_spr_604 (CPUPPCState
*env
)
859 /* Processor identification */
860 spr_register(env
, SPR_PIR
, "PIR",
861 SPR_NOACCESS
, SPR_NOACCESS
,
862 &spr_read_generic
, &spr_write_pir
,
865 /* XXX : not implemented */
866 spr_register(env
, SPR_IABR
, "IABR",
867 SPR_NOACCESS
, SPR_NOACCESS
,
868 &spr_read_generic
, &spr_write_generic
,
870 /* XXX : not implemented */
871 spr_register(env
, SPR_DABR
, "DABR",
872 SPR_NOACCESS
, SPR_NOACCESS
,
873 &spr_read_generic
, &spr_write_generic
,
875 /* Performance counters */
876 /* XXX : not implemented */
877 spr_register(env
, SPR_MMCR0
, "MMCR0",
878 SPR_NOACCESS
, SPR_NOACCESS
,
879 &spr_read_generic
, &spr_write_generic
,
881 /* XXX : not implemented */
882 spr_register(env
, SPR_MMCR1
, "MMCR1",
883 SPR_NOACCESS
, SPR_NOACCESS
,
884 &spr_read_generic
, &spr_write_generic
,
886 /* XXX : not implemented */
887 spr_register(env
, SPR_PMC1
, "PMC1",
888 SPR_NOACCESS
, SPR_NOACCESS
,
889 &spr_read_generic
, &spr_write_generic
,
891 /* XXX : not implemented */
892 spr_register(env
, SPR_PMC2
, "PMC2",
893 SPR_NOACCESS
, SPR_NOACCESS
,
894 &spr_read_generic
, &spr_write_generic
,
896 /* XXX : not implemented */
897 spr_register(env
, SPR_PMC3
, "PMC3",
898 SPR_NOACCESS
, SPR_NOACCESS
,
899 &spr_read_generic
, &spr_write_generic
,
901 /* XXX : not implemented */
902 spr_register(env
, SPR_PMC4
, "PMC4",
903 SPR_NOACCESS
, SPR_NOACCESS
,
904 &spr_read_generic
, &spr_write_generic
,
906 /* XXX : not implemented */
907 spr_register(env
, SPR_SIA
, "SIA",
908 SPR_NOACCESS
, SPR_NOACCESS
,
909 &spr_read_generic
, SPR_NOACCESS
,
911 /* XXX : not implemented */
912 spr_register(env
, SPR_SDA
, "SDA",
913 SPR_NOACCESS
, SPR_NOACCESS
,
914 &spr_read_generic
, SPR_NOACCESS
,
916 /* External access control */
917 /* XXX : not implemented */
918 spr_register(env
, SPR_EAR
, "EAR",
919 SPR_NOACCESS
, SPR_NOACCESS
,
920 &spr_read_generic
, &spr_write_generic
,
924 /* SPR specific to PowerPC 603 implementation */
925 static void gen_spr_603 (CPUPPCState
*env
)
927 /* External access control */
928 /* XXX : not implemented */
929 spr_register(env
, SPR_EAR
, "EAR",
930 SPR_NOACCESS
, SPR_NOACCESS
,
931 &spr_read_generic
, &spr_write_generic
,
935 /* SPR specific to PowerPC G2 implementation */
936 static void gen_spr_G2 (CPUPPCState
*env
)
938 /* Memory base address */
940 spr_register(env
, SPR_MBAR
, "MBAR",
941 SPR_NOACCESS
, SPR_NOACCESS
,
942 &spr_read_generic
, &spr_write_generic
,
944 /* System version register */
946 spr_register(env
, SPR_SVR
, "SVR",
947 SPR_NOACCESS
, SPR_NOACCESS
,
948 &spr_read_generic
, SPR_NOACCESS
,
950 /* Exception processing */
951 spr_register(env
, SPR_BOOKE_CSRR0
, "CSRR0",
952 SPR_NOACCESS
, SPR_NOACCESS
,
953 &spr_read_generic
, &spr_write_generic
,
955 spr_register(env
, SPR_BOOKE_CSRR1
, "CSRR1",
956 SPR_NOACCESS
, SPR_NOACCESS
,
957 &spr_read_generic
, &spr_write_generic
,
960 /* XXX : not implemented */
961 spr_register(env
, SPR_DABR
, "DABR",
962 SPR_NOACCESS
, SPR_NOACCESS
,
963 &spr_read_generic
, &spr_write_generic
,
965 /* XXX : not implemented */
966 spr_register(env
, SPR_DABR2
, "DABR2",
967 SPR_NOACCESS
, SPR_NOACCESS
,
968 &spr_read_generic
, &spr_write_generic
,
970 /* XXX : not implemented */
971 spr_register(env
, SPR_IABR
, "IABR",
972 SPR_NOACCESS
, SPR_NOACCESS
,
973 &spr_read_generic
, &spr_write_generic
,
975 /* XXX : not implemented */
976 spr_register(env
, SPR_IABR2
, "IABR2",
977 SPR_NOACCESS
, SPR_NOACCESS
,
978 &spr_read_generic
, &spr_write_generic
,
980 /* XXX : not implemented */
981 spr_register(env
, SPR_IBCR
, "IBCR",
982 SPR_NOACCESS
, SPR_NOACCESS
,
983 &spr_read_generic
, &spr_write_generic
,
985 /* XXX : not implemented */
986 spr_register(env
, SPR_DBCR
, "DBCR",
987 SPR_NOACCESS
, SPR_NOACCESS
,
988 &spr_read_generic
, &spr_write_generic
,
992 /* SPR specific to PowerPC 602 implementation */
993 static void gen_spr_602 (CPUPPCState
*env
)
996 /* XXX : not implemented */
997 spr_register(env
, SPR_SER
, "SER",
998 SPR_NOACCESS
, SPR_NOACCESS
,
999 &spr_read_generic
, &spr_write_generic
,
1001 /* XXX : not implemented */
1002 spr_register(env
, SPR_SEBR
, "SEBR",
1003 SPR_NOACCESS
, SPR_NOACCESS
,
1004 &spr_read_generic
, &spr_write_generic
,
1006 /* XXX : not implemented */
1007 spr_register(env
, SPR_ESASR
, "ESASR",
1008 SPR_NOACCESS
, SPR_NOACCESS
,
1009 &spr_read_generic
, &spr_write_generic
,
1011 /* Floating point status */
1012 /* XXX : not implemented */
1013 spr_register(env
, SPR_SP
, "SP",
1014 SPR_NOACCESS
, SPR_NOACCESS
,
1015 &spr_read_generic
, &spr_write_generic
,
1017 /* XXX : not implemented */
1018 spr_register(env
, SPR_LT
, "LT",
1019 SPR_NOACCESS
, SPR_NOACCESS
,
1020 &spr_read_generic
, &spr_write_generic
,
1022 /* Watchdog timer */
1023 /* XXX : not implemented */
1024 spr_register(env
, SPR_TCR
, "TCR",
1025 SPR_NOACCESS
, SPR_NOACCESS
,
1026 &spr_read_generic
, &spr_write_generic
,
1028 /* Interrupt base */
1029 spr_register(env
, SPR_IBR
, "IBR",
1030 SPR_NOACCESS
, SPR_NOACCESS
,
1031 &spr_read_generic
, &spr_write_generic
,
1035 /* SPR specific to PowerPC 601 implementation */
1036 static void gen_spr_601 (CPUPPCState
*env
)
1038 /* Multiplication/division register */
1040 spr_register(env
, SPR_MQ
, "MQ",
1041 &spr_read_generic
, &spr_write_generic
,
1042 &spr_read_generic
, &spr_write_generic
,
1045 spr_register(env
, SPR_601_RTCU
, "RTCU",
1046 SPR_NOACCESS
, SPR_NOACCESS
,
1047 SPR_NOACCESS
, &spr_write_601_rtcu
,
1049 spr_register(env
, SPR_601_VRTCU
, "RTCU",
1050 &spr_read_601_rtcu
, SPR_NOACCESS
,
1051 &spr_read_601_rtcu
, SPR_NOACCESS
,
1053 spr_register(env
, SPR_601_RTCL
, "RTCL",
1054 SPR_NOACCESS
, SPR_NOACCESS
,
1055 SPR_NOACCESS
, &spr_write_601_rtcl
,
1057 spr_register(env
, SPR_601_VRTCL
, "RTCL",
1058 &spr_read_601_rtcl
, SPR_NOACCESS
,
1059 &spr_read_601_rtcl
, SPR_NOACCESS
,
1063 spr_register(env
, SPR_601_UDECR
, "UDECR",
1064 &spr_read_decr
, SPR_NOACCESS
,
1065 &spr_read_decr
, SPR_NOACCESS
,
1068 /* External access control */
1069 /* XXX : not implemented */
1070 spr_register(env
, SPR_EAR
, "EAR",
1071 SPR_NOACCESS
, SPR_NOACCESS
,
1072 &spr_read_generic
, &spr_write_generic
,
1074 /* Memory management */
1075 spr_register(env
, SPR_IBAT0U
, "IBAT0U",
1076 SPR_NOACCESS
, SPR_NOACCESS
,
1077 &spr_read_601_ubat
, &spr_write_601_ubatu
,
1079 spr_register(env
, SPR_IBAT0L
, "IBAT0L",
1080 SPR_NOACCESS
, SPR_NOACCESS
,
1081 &spr_read_601_ubat
, &spr_write_601_ubatl
,
1083 spr_register(env
, SPR_IBAT1U
, "IBAT1U",
1084 SPR_NOACCESS
, SPR_NOACCESS
,
1085 &spr_read_601_ubat
, &spr_write_601_ubatu
,
1087 spr_register(env
, SPR_IBAT1L
, "IBAT1L",
1088 SPR_NOACCESS
, SPR_NOACCESS
,
1089 &spr_read_601_ubat
, &spr_write_601_ubatl
,
1091 spr_register(env
, SPR_IBAT2U
, "IBAT2U",
1092 SPR_NOACCESS
, SPR_NOACCESS
,
1093 &spr_read_601_ubat
, &spr_write_601_ubatu
,
1095 spr_register(env
, SPR_IBAT2L
, "IBAT2L",
1096 SPR_NOACCESS
, SPR_NOACCESS
,
1097 &spr_read_601_ubat
, &spr_write_601_ubatl
,
1099 spr_register(env
, SPR_IBAT3U
, "IBAT3U",
1100 SPR_NOACCESS
, SPR_NOACCESS
,
1101 &spr_read_601_ubat
, &spr_write_601_ubatu
,
1103 spr_register(env
, SPR_IBAT3L
, "IBAT3L",
1104 SPR_NOACCESS
, SPR_NOACCESS
,
1105 &spr_read_601_ubat
, &spr_write_601_ubatl
,
1109 /* PowerPC BookE SPR */
1110 static void gen_spr_BookE (CPUPPCState
*env
)
1112 /* Processor identification */
1113 spr_register(env
, SPR_BOOKE_PIR
, "PIR",
1114 SPR_NOACCESS
, SPR_NOACCESS
,
1115 &spr_read_generic
, &spr_write_pir
,
1117 /* Interrupt processing */
1118 spr_register(env
, SPR_BOOKE_CSRR0
, "CSRR0",
1119 SPR_NOACCESS
, SPR_NOACCESS
,
1120 &spr_read_generic
, &spr_write_generic
,
1122 spr_register(env
, SPR_BOOKE_CSRR1
, "CSRR1",
1123 SPR_NOACCESS
, SPR_NOACCESS
,
1124 &spr_read_generic
, &spr_write_generic
,
1127 spr_register(env
, SPR_BOOKE_DSRR0
, "DSRR0",
1128 SPR_NOACCESS
, SPR_NOACCESS
,
1129 &spr_read_generic
, &spr_write_generic
,
1131 spr_register(env
, SPR_BOOKE_DSRR1
, "DSRR1",
1132 SPR_NOACCESS
, SPR_NOACCESS
,
1133 &spr_read_generic
, &spr_write_generic
,
1135 spr_register(env
, SPR_BOOKE_MCSRR0
, "MCSRR0",
1136 SPR_NOACCESS
, SPR_NOACCESS
,
1137 &spr_read_generic
, &spr_write_generic
,
1139 spr_register(env
, SPR_BOOKE_MCSRR1
, "MCSRR1",
1140 SPR_NOACCESS
, SPR_NOACCESS
,
1141 &spr_read_generic
, &spr_write_generic
,
1145 /* XXX : not implemented */
1146 spr_register(env
, SPR_BOOKE_IAC1
, "IAC1",
1147 SPR_NOACCESS
, SPR_NOACCESS
,
1148 &spr_read_generic
, &spr_write_generic
,
1150 /* XXX : not implemented */
1151 spr_register(env
, SPR_BOOKE_IAC2
, "IAC2",
1152 SPR_NOACCESS
, SPR_NOACCESS
,
1153 &spr_read_generic
, &spr_write_generic
,
1155 /* XXX : not implemented */
1156 spr_register(env
, SPR_BOOKE_IAC3
, "IAC3",
1157 SPR_NOACCESS
, SPR_NOACCESS
,
1158 &spr_read_generic
, &spr_write_generic
,
1160 /* XXX : not implemented */
1161 spr_register(env
, SPR_BOOKE_IAC4
, "IAC4",
1162 SPR_NOACCESS
, SPR_NOACCESS
,
1163 &spr_read_generic
, &spr_write_generic
,
1165 /* XXX : not implemented */
1166 spr_register(env
, SPR_BOOKE_DAC1
, "DAC1",
1167 SPR_NOACCESS
, SPR_NOACCESS
,
1168 &spr_read_generic
, &spr_write_generic
,
1170 /* XXX : not implemented */
1171 spr_register(env
, SPR_BOOKE_DAC2
, "DAC2",
1172 SPR_NOACCESS
, SPR_NOACCESS
,
1173 &spr_read_generic
, &spr_write_generic
,
1175 /* XXX : not implemented */
1176 spr_register(env
, SPR_BOOKE_DVC1
, "DVC1",
1177 SPR_NOACCESS
, SPR_NOACCESS
,
1178 &spr_read_generic
, &spr_write_generic
,
1180 /* XXX : not implemented */
1181 spr_register(env
, SPR_BOOKE_DVC2
, "DVC2",
1182 SPR_NOACCESS
, SPR_NOACCESS
,
1183 &spr_read_generic
, &spr_write_generic
,
1185 /* XXX : not implemented */
1186 spr_register(env
, SPR_BOOKE_DBCR0
, "DBCR0",
1187 SPR_NOACCESS
, SPR_NOACCESS
,
1188 &spr_read_generic
, &spr_write_generic
,
1190 /* XXX : not implemented */
1191 spr_register(env
, SPR_BOOKE_DBCR1
, "DBCR1",
1192 SPR_NOACCESS
, SPR_NOACCESS
,
1193 &spr_read_generic
, &spr_write_generic
,
1195 /* XXX : not implemented */
1196 spr_register(env
, SPR_BOOKE_DBCR2
, "DBCR2",
1197 SPR_NOACCESS
, SPR_NOACCESS
,
1198 &spr_read_generic
, &spr_write_generic
,
1200 /* XXX : not implemented */
1201 spr_register(env
, SPR_BOOKE_DBSR
, "DBSR",
1202 SPR_NOACCESS
, SPR_NOACCESS
,
1203 &spr_read_generic
, &spr_write_clear
,
1205 spr_register(env
, SPR_BOOKE_DEAR
, "DEAR",
1206 SPR_NOACCESS
, SPR_NOACCESS
,
1207 &spr_read_generic
, &spr_write_generic
,
1209 spr_register(env
, SPR_BOOKE_ESR
, "ESR",
1210 SPR_NOACCESS
, SPR_NOACCESS
,
1211 &spr_read_generic
, &spr_write_generic
,
1213 spr_register(env
, SPR_BOOKE_IVPR
, "IVPR",
1214 SPR_NOACCESS
, SPR_NOACCESS
,
1215 &spr_read_generic
, &spr_write_generic
,
1217 /* Exception vectors */
1218 spr_register(env
, SPR_BOOKE_IVOR0
, "IVOR0",
1219 SPR_NOACCESS
, SPR_NOACCESS
,
1220 &spr_read_generic
, &spr_write_generic
,
1222 spr_register(env
, SPR_BOOKE_IVOR1
, "IVOR1",
1223 SPR_NOACCESS
, SPR_NOACCESS
,
1224 &spr_read_generic
, &spr_write_generic
,
1226 spr_register(env
, SPR_BOOKE_IVOR2
, "IVOR2",
1227 SPR_NOACCESS
, SPR_NOACCESS
,
1228 &spr_read_generic
, &spr_write_generic
,
1230 spr_register(env
, SPR_BOOKE_IVOR3
, "IVOR3",
1231 SPR_NOACCESS
, SPR_NOACCESS
,
1232 &spr_read_generic
, &spr_write_generic
,
1234 spr_register(env
, SPR_BOOKE_IVOR4
, "IVOR4",
1235 SPR_NOACCESS
, SPR_NOACCESS
,
1236 &spr_read_generic
, &spr_write_generic
,
1238 spr_register(env
, SPR_BOOKE_IVOR5
, "IVOR5",
1239 SPR_NOACCESS
, SPR_NOACCESS
,
1240 &spr_read_generic
, &spr_write_generic
,
1242 spr_register(env
, SPR_BOOKE_IVOR6
, "IVOR6",
1243 SPR_NOACCESS
, SPR_NOACCESS
,
1244 &spr_read_generic
, &spr_write_generic
,
1246 spr_register(env
, SPR_BOOKE_IVOR7
, "IVOR7",
1247 SPR_NOACCESS
, SPR_NOACCESS
,
1248 &spr_read_generic
, &spr_write_generic
,
1250 spr_register(env
, SPR_BOOKE_IVOR8
, "IVOR8",
1251 SPR_NOACCESS
, SPR_NOACCESS
,
1252 &spr_read_generic
, &spr_write_generic
,
1254 spr_register(env
, SPR_BOOKE_IVOR9
, "IVOR9",
1255 SPR_NOACCESS
, SPR_NOACCESS
,
1256 &spr_read_generic
, &spr_write_generic
,
1258 spr_register(env
, SPR_BOOKE_IVOR10
, "IVOR10",
1259 SPR_NOACCESS
, SPR_NOACCESS
,
1260 &spr_read_generic
, &spr_write_generic
,
1262 spr_register(env
, SPR_BOOKE_IVOR11
, "IVOR11",
1263 SPR_NOACCESS
, SPR_NOACCESS
,
1264 &spr_read_generic
, &spr_write_generic
,
1266 spr_register(env
, SPR_BOOKE_IVOR12
, "IVOR12",
1267 SPR_NOACCESS
, SPR_NOACCESS
,
1268 &spr_read_generic
, &spr_write_generic
,
1270 spr_register(env
, SPR_BOOKE_IVOR13
, "IVOR13",
1271 SPR_NOACCESS
, SPR_NOACCESS
,
1272 &spr_read_generic
, &spr_write_generic
,
1274 spr_register(env
, SPR_BOOKE_IVOR14
, "IVOR14",
1275 SPR_NOACCESS
, SPR_NOACCESS
,
1276 &spr_read_generic
, &spr_write_generic
,
1278 spr_register(env
, SPR_BOOKE_IVOR15
, "IVOR15",
1279 SPR_NOACCESS
, SPR_NOACCESS
,
1280 &spr_read_generic
, &spr_write_generic
,
1283 spr_register(env
, SPR_BOOKE_IVOR32
, "IVOR32",
1284 SPR_NOACCESS
, SPR_NOACCESS
,
1285 &spr_read_generic
, &spr_write_generic
,
1287 spr_register(env
, SPR_BOOKE_IVOR33
, "IVOR33",
1288 SPR_NOACCESS
, SPR_NOACCESS
,
1289 &spr_read_generic
, &spr_write_generic
,
1291 spr_register(env
, SPR_BOOKE_IVOR34
, "IVOR34",
1292 SPR_NOACCESS
, SPR_NOACCESS
,
1293 &spr_read_generic
, &spr_write_generic
,
1295 spr_register(env
, SPR_BOOKE_IVOR35
, "IVOR35",
1296 SPR_NOACCESS
, SPR_NOACCESS
,
1297 &spr_read_generic
, &spr_write_generic
,
1299 spr_register(env
, SPR_BOOKE_IVOR36
, "IVOR36",
1300 SPR_NOACCESS
, SPR_NOACCESS
,
1301 &spr_read_generic
, &spr_write_generic
,
1303 spr_register(env
, SPR_BOOKE_IVOR37
, "IVOR37",
1304 SPR_NOACCESS
, SPR_NOACCESS
,
1305 &spr_read_generic
, &spr_write_generic
,
1308 spr_register(env
, SPR_BOOKE_PID
, "PID",
1309 SPR_NOACCESS
, SPR_NOACCESS
,
1310 &spr_read_generic
, &spr_write_generic
,
1312 spr_register(env
, SPR_BOOKE_TCR
, "TCR",
1313 SPR_NOACCESS
, SPR_NOACCESS
,
1314 &spr_read_generic
, &spr_write_booke_tcr
,
1316 spr_register(env
, SPR_BOOKE_TSR
, "TSR",
1317 SPR_NOACCESS
, SPR_NOACCESS
,
1318 &spr_read_generic
, &spr_write_booke_tsr
,
1321 spr_register(env
, SPR_DECR
, "DECR",
1322 SPR_NOACCESS
, SPR_NOACCESS
,
1323 &spr_read_decr
, &spr_write_decr
,
1325 spr_register(env
, SPR_BOOKE_DECAR
, "DECAR",
1326 SPR_NOACCESS
, SPR_NOACCESS
,
1327 SPR_NOACCESS
, &spr_write_generic
,
1330 spr_register(env
, SPR_USPRG0
, "USPRG0",
1331 &spr_read_generic
, &spr_write_generic
,
1332 &spr_read_generic
, &spr_write_generic
,
1334 spr_register(env
, SPR_SPRG4
, "SPRG4",
1335 SPR_NOACCESS
, SPR_NOACCESS
,
1336 &spr_read_generic
, &spr_write_generic
,
1338 spr_register(env
, SPR_USPRG4
, "USPRG4",
1339 &spr_read_ureg
, SPR_NOACCESS
,
1340 &spr_read_ureg
, SPR_NOACCESS
,
1342 spr_register(env
, SPR_SPRG5
, "SPRG5",
1343 SPR_NOACCESS
, SPR_NOACCESS
,
1344 &spr_read_generic
, &spr_write_generic
,
1346 spr_register(env
, SPR_USPRG5
, "USPRG5",
1347 &spr_read_ureg
, SPR_NOACCESS
,
1348 &spr_read_ureg
, SPR_NOACCESS
,
1350 spr_register(env
, SPR_SPRG6
, "SPRG6",
1351 SPR_NOACCESS
, SPR_NOACCESS
,
1352 &spr_read_generic
, &spr_write_generic
,
1354 spr_register(env
, SPR_USPRG6
, "USPRG6",
1355 &spr_read_ureg
, SPR_NOACCESS
,
1356 &spr_read_ureg
, SPR_NOACCESS
,
1358 spr_register(env
, SPR_SPRG7
, "SPRG7",
1359 SPR_NOACCESS
, SPR_NOACCESS
,
1360 &spr_read_generic
, &spr_write_generic
,
1362 spr_register(env
, SPR_USPRG7
, "USPRG7",
1363 &spr_read_ureg
, SPR_NOACCESS
,
1364 &spr_read_ureg
, SPR_NOACCESS
,
1368 /* FSL storage control registers */
1369 static void gen_spr_BookE_FSL (CPUPPCState
*env
)
1371 /* TLB assist registers */
1372 spr_register(env
, SPR_BOOKE_MAS0
, "MAS0",
1373 SPR_NOACCESS
, SPR_NOACCESS
,
1374 &spr_read_generic
, &spr_write_generic
,
1376 spr_register(env
, SPR_BOOKE_MAS1
, "MAS2",
1377 SPR_NOACCESS
, SPR_NOACCESS
,
1378 &spr_read_generic
, &spr_write_generic
,
1380 spr_register(env
, SPR_BOOKE_MAS2
, "MAS3",
1381 SPR_NOACCESS
, SPR_NOACCESS
,
1382 &spr_read_generic
, &spr_write_generic
,
1384 spr_register(env
, SPR_BOOKE_MAS3
, "MAS4",
1385 SPR_NOACCESS
, SPR_NOACCESS
,
1386 &spr_read_generic
, &spr_write_generic
,
1388 spr_register(env
, SPR_BOOKE_MAS4
, "MAS5",
1389 SPR_NOACCESS
, SPR_NOACCESS
,
1390 &spr_read_generic
, &spr_write_generic
,
1392 spr_register(env
, SPR_BOOKE_MAS6
, "MAS6",
1393 SPR_NOACCESS
, SPR_NOACCESS
,
1394 &spr_read_generic
, &spr_write_generic
,
1396 spr_register(env
, SPR_BOOKE_MAS7
, "MAS7",
1397 SPR_NOACCESS
, SPR_NOACCESS
,
1398 &spr_read_generic
, &spr_write_generic
,
1400 if (env
->nb_pids
> 1) {
1401 spr_register(env
, SPR_BOOKE_PID1
, "PID1",
1402 SPR_NOACCESS
, SPR_NOACCESS
,
1403 &spr_read_generic
, &spr_write_generic
,
1406 if (env
->nb_pids
> 2) {
1407 spr_register(env
, SPR_BOOKE_PID2
, "PID2",
1408 SPR_NOACCESS
, SPR_NOACCESS
,
1409 &spr_read_generic
, &spr_write_generic
,
1412 spr_register(env
, SPR_BOOKE_MMUCFG
, "MMUCFG",
1413 SPR_NOACCESS
, SPR_NOACCESS
,
1414 &spr_read_generic
, SPR_NOACCESS
,
1415 0x00000000); /* TOFIX */
1416 spr_register(env
, SPR_BOOKE_MMUCSR0
, "MMUCSR0",
1417 SPR_NOACCESS
, SPR_NOACCESS
,
1418 &spr_read_generic
, &spr_write_generic
,
1419 0x00000000); /* TOFIX */
1420 switch (env
->nb_ways
) {
1422 spr_register(env
, SPR_BOOKE_TLB3CFG
, "TLB3CFG",
1423 SPR_NOACCESS
, SPR_NOACCESS
,
1424 &spr_read_generic
, SPR_NOACCESS
,
1425 0x00000000); /* TOFIX */
1428 spr_register(env
, SPR_BOOKE_TLB2CFG
, "TLB2CFG",
1429 SPR_NOACCESS
, SPR_NOACCESS
,
1430 &spr_read_generic
, SPR_NOACCESS
,
1431 0x00000000); /* TOFIX */
1434 spr_register(env
, SPR_BOOKE_TLB1CFG
, "TLB1CFG",
1435 SPR_NOACCESS
, SPR_NOACCESS
,
1436 &spr_read_generic
, SPR_NOACCESS
,
1437 0x00000000); /* TOFIX */
1440 spr_register(env
, SPR_BOOKE_TLB0CFG
, "TLB0CFG",
1441 SPR_NOACCESS
, SPR_NOACCESS
,
1442 &spr_read_generic
, SPR_NOACCESS
,
1443 0x00000000); /* TOFIX */
1451 /* SPR specific to PowerPC 440 implementation */
1452 static void gen_spr_440 (CPUPPCState
*env
)
1455 /* XXX : not implemented */
1456 spr_register(env
, SPR_440_DNV0
, "DNV0",
1457 SPR_NOACCESS
, SPR_NOACCESS
,
1458 &spr_read_generic
, &spr_write_generic
,
1460 /* XXX : not implemented */
1461 spr_register(env
, SPR_440_DNV1
, "DNV1",
1462 SPR_NOACCESS
, SPR_NOACCESS
,
1463 &spr_read_generic
, &spr_write_generic
,
1465 /* XXX : not implemented */
1466 spr_register(env
, SPR_440_DNV2
, "DNV2",
1467 SPR_NOACCESS
, SPR_NOACCESS
,
1468 &spr_read_generic
, &spr_write_generic
,
1470 /* XXX : not implemented */
1471 spr_register(env
, SPR_440_DNV3
, "DNV3",
1472 SPR_NOACCESS
, SPR_NOACCESS
,
1473 &spr_read_generic
, &spr_write_generic
,
1475 /* XXX : not implemented */
1476 spr_register(env
, SPR_440_DTV0
, "DTV0",
1477 SPR_NOACCESS
, SPR_NOACCESS
,
1478 &spr_read_generic
, &spr_write_generic
,
1480 /* XXX : not implemented */
1481 spr_register(env
, SPR_440_DTV1
, "DTV1",
1482 SPR_NOACCESS
, SPR_NOACCESS
,
1483 &spr_read_generic
, &spr_write_generic
,
1485 /* XXX : not implemented */
1486 spr_register(env
, SPR_440_DTV2
, "DTV2",
1487 SPR_NOACCESS
, SPR_NOACCESS
,
1488 &spr_read_generic
, &spr_write_generic
,
1490 /* XXX : not implemented */
1491 spr_register(env
, SPR_440_DTV3
, "DTV3",
1492 SPR_NOACCESS
, SPR_NOACCESS
,
1493 &spr_read_generic
, &spr_write_generic
,
1495 /* XXX : not implemented */
1496 spr_register(env
, SPR_440_DVLIM
, "DVLIM",
1497 SPR_NOACCESS
, SPR_NOACCESS
,
1498 &spr_read_generic
, &spr_write_generic
,
1500 /* XXX : not implemented */
1501 spr_register(env
, SPR_440_INV0
, "INV0",
1502 SPR_NOACCESS
, SPR_NOACCESS
,
1503 &spr_read_generic
, &spr_write_generic
,
1505 /* XXX : not implemented */
1506 spr_register(env
, SPR_440_INV1
, "INV1",
1507 SPR_NOACCESS
, SPR_NOACCESS
,
1508 &spr_read_generic
, &spr_write_generic
,
1510 /* XXX : not implemented */
1511 spr_register(env
, SPR_440_INV2
, "INV2",
1512 SPR_NOACCESS
, SPR_NOACCESS
,
1513 &spr_read_generic
, &spr_write_generic
,
1515 /* XXX : not implemented */
1516 spr_register(env
, SPR_440_INV3
, "INV3",
1517 SPR_NOACCESS
, SPR_NOACCESS
,
1518 &spr_read_generic
, &spr_write_generic
,
1520 /* XXX : not implemented */
1521 spr_register(env
, SPR_440_ITV0
, "ITV0",
1522 SPR_NOACCESS
, SPR_NOACCESS
,
1523 &spr_read_generic
, &spr_write_generic
,
1525 /* XXX : not implemented */
1526 spr_register(env
, SPR_440_ITV1
, "ITV1",
1527 SPR_NOACCESS
, SPR_NOACCESS
,
1528 &spr_read_generic
, &spr_write_generic
,
1530 /* XXX : not implemented */
1531 spr_register(env
, SPR_440_ITV2
, "ITV2",
1532 SPR_NOACCESS
, SPR_NOACCESS
,
1533 &spr_read_generic
, &spr_write_generic
,
1535 /* XXX : not implemented */
1536 spr_register(env
, SPR_440_ITV3
, "ITV3",
1537 SPR_NOACCESS
, SPR_NOACCESS
,
1538 &spr_read_generic
, &spr_write_generic
,
1540 /* XXX : not implemented */
1541 spr_register(env
, SPR_440_IVLIM
, "IVLIM",
1542 SPR_NOACCESS
, SPR_NOACCESS
,
1543 &spr_read_generic
, &spr_write_generic
,
1546 /* XXX : not implemented */
1547 spr_register(env
, SPR_BOOKE_DCDBTRH
, "DCDBTRH",
1548 SPR_NOACCESS
, SPR_NOACCESS
,
1549 &spr_read_generic
, SPR_NOACCESS
,
1551 /* XXX : not implemented */
1552 spr_register(env
, SPR_BOOKE_DCDBTRL
, "DCDBTRL",
1553 SPR_NOACCESS
, SPR_NOACCESS
,
1554 &spr_read_generic
, SPR_NOACCESS
,
1556 /* XXX : not implemented */
1557 spr_register(env
, SPR_BOOKE_ICDBDR
, "ICDBDR",
1558 SPR_NOACCESS
, SPR_NOACCESS
,
1559 &spr_read_generic
, SPR_NOACCESS
,
1561 /* XXX : not implemented */
1562 spr_register(env
, SPR_BOOKE_ICDBTRH
, "ICDBTRH",
1563 SPR_NOACCESS
, SPR_NOACCESS
,
1564 &spr_read_generic
, SPR_NOACCESS
,
1566 /* XXX : not implemented */
1567 spr_register(env
, SPR_BOOKE_ICDBTRL
, "ICDBTRL",
1568 SPR_NOACCESS
, SPR_NOACCESS
,
1569 &spr_read_generic
, SPR_NOACCESS
,
1571 /* XXX : not implemented */
1572 spr_register(env
, SPR_440_DBDR
, "DBDR",
1573 SPR_NOACCESS
, SPR_NOACCESS
,
1574 &spr_read_generic
, &spr_write_generic
,
1576 /* Processor control */
1577 spr_register(env
, SPR_4xx_CCR0
, "CCR0",
1578 SPR_NOACCESS
, SPR_NOACCESS
,
1579 &spr_read_generic
, &spr_write_generic
,
1581 spr_register(env
, SPR_440_RSTCFG
, "RSTCFG",
1582 SPR_NOACCESS
, SPR_NOACCESS
,
1583 &spr_read_generic
, SPR_NOACCESS
,
1585 /* Storage control */
1586 spr_register(env
, SPR_440_MMUCR
, "MMUCR",
1587 SPR_NOACCESS
, SPR_NOACCESS
,
1588 &spr_read_generic
, &spr_write_generic
,
1592 /* SPR shared between PowerPC 40x implementations */
1593 static void gen_spr_40x (CPUPPCState
*env
)
1596 /* XXX : not implemented */
1597 spr_register(env
, SPR_40x_DCCR
, "DCCR",
1598 SPR_NOACCESS
, SPR_NOACCESS
,
1599 &spr_read_generic
, &spr_write_generic
,
1601 /* XXX : not implemented */
1602 spr_register(env
, SPR_40x_DCWR
, "DCWR",
1603 SPR_NOACCESS
, SPR_NOACCESS
,
1604 &spr_read_generic
, &spr_write_generic
,
1606 /* XXX : not implemented */
1607 spr_register(env
, SPR_40x_ICCR
, "ICCR",
1608 SPR_NOACCESS
, SPR_NOACCESS
,
1609 &spr_read_generic
, &spr_write_generic
,
1611 /* XXX : not implemented */
1612 spr_register(env
, SPR_BOOKE_ICDBDR
, "ICDBDR",
1613 SPR_NOACCESS
, SPR_NOACCESS
,
1614 &spr_read_generic
, SPR_NOACCESS
,
1616 /* Bus access control */
1617 spr_register(env
, SPR_40x_SGR
, "SGR",
1618 SPR_NOACCESS
, SPR_NOACCESS
,
1619 &spr_read_generic
, &spr_write_generic
,
1622 spr_register(env
, SPR_40x_DEAR
, "DEAR",
1623 SPR_NOACCESS
, SPR_NOACCESS
,
1624 &spr_read_generic
, &spr_write_generic
,
1626 spr_register(env
, SPR_40x_ESR
, "ESR",
1627 SPR_NOACCESS
, SPR_NOACCESS
,
1628 &spr_read_generic
, &spr_write_generic
,
1630 spr_register(env
, SPR_40x_EVPR
, "EVPR",
1631 SPR_NOACCESS
, SPR_NOACCESS
,
1632 &spr_read_generic
, &spr_write_generic
,
1634 spr_register(env
, SPR_40x_SRR2
, "SRR2",
1635 &spr_read_generic
, &spr_write_generic
,
1636 &spr_read_generic
, &spr_write_generic
,
1638 spr_register(env
, SPR_40x_SRR3
, "SRR3",
1639 &spr_read_generic
, &spr_write_generic
,
1640 &spr_read_generic
, &spr_write_generic
,
1643 spr_register(env
, SPR_40x_PIT
, "PIT",
1644 SPR_NOACCESS
, SPR_NOACCESS
,
1645 &spr_read_40x_pit
, &spr_write_40x_pit
,
1647 spr_register(env
, SPR_40x_TCR
, "TCR",
1648 SPR_NOACCESS
, SPR_NOACCESS
,
1649 &spr_read_generic
, &spr_write_booke_tcr
,
1651 spr_register(env
, SPR_40x_TSR
, "TSR",
1652 SPR_NOACCESS
, SPR_NOACCESS
,
1653 &spr_read_generic
, &spr_write_booke_tsr
,
1657 /* SPR specific to PowerPC 405 implementation */
1658 static void gen_spr_405 (CPUPPCState
*env
)
1661 spr_register(env
, SPR_40x_PID
, "PID",
1662 SPR_NOACCESS
, SPR_NOACCESS
,
1663 &spr_read_generic
, &spr_write_generic
,
1665 spr_register(env
, SPR_4xx_CCR0
, "CCR0",
1666 SPR_NOACCESS
, SPR_NOACCESS
,
1667 &spr_read_generic
, &spr_write_generic
,
1669 /* Debug interface */
1670 /* XXX : not implemented */
1671 spr_register(env
, SPR_40x_DBCR0
, "DBCR0",
1672 SPR_NOACCESS
, SPR_NOACCESS
,
1673 &spr_read_generic
, &spr_write_40x_dbcr0
,
1675 /* XXX : not implemented */
1676 spr_register(env
, SPR_405_DBCR1
, "DBCR1",
1677 SPR_NOACCESS
, SPR_NOACCESS
,
1678 &spr_read_generic
, &spr_write_generic
,
1680 /* XXX : not implemented */
1681 spr_register(env
, SPR_40x_DBSR
, "DBSR",
1682 SPR_NOACCESS
, SPR_NOACCESS
,
1683 &spr_read_generic
, &spr_write_clear
,
1684 /* Last reset was system reset */
1686 /* XXX : not implemented */
1687 spr_register(env
, SPR_40x_DAC1
, "DAC1",
1688 SPR_NOACCESS
, SPR_NOACCESS
,
1689 &spr_read_generic
, &spr_write_generic
,
1691 spr_register(env
, SPR_40x_DAC2
, "DAC2",
1692 SPR_NOACCESS
, SPR_NOACCESS
,
1693 &spr_read_generic
, &spr_write_generic
,
1695 /* XXX : not implemented */
1696 spr_register(env
, SPR_405_DVC1
, "DVC1",
1697 SPR_NOACCESS
, SPR_NOACCESS
,
1698 &spr_read_generic
, &spr_write_generic
,
1700 /* XXX : not implemented */
1701 spr_register(env
, SPR_405_DVC2
, "DVC2",
1702 SPR_NOACCESS
, SPR_NOACCESS
,
1703 &spr_read_generic
, &spr_write_generic
,
1705 /* XXX : not implemented */
1706 spr_register(env
, SPR_40x_IAC1
, "IAC1",
1707 SPR_NOACCESS
, SPR_NOACCESS
,
1708 &spr_read_generic
, &spr_write_generic
,
1710 spr_register(env
, SPR_40x_IAC2
, "IAC2",
1711 SPR_NOACCESS
, SPR_NOACCESS
,
1712 &spr_read_generic
, &spr_write_generic
,
1714 /* XXX : not implemented */
1715 spr_register(env
, SPR_405_IAC3
, "IAC3",
1716 SPR_NOACCESS
, SPR_NOACCESS
,
1717 &spr_read_generic
, &spr_write_generic
,
1719 /* XXX : not implemented */
1720 spr_register(env
, SPR_405_IAC4
, "IAC4",
1721 SPR_NOACCESS
, SPR_NOACCESS
,
1722 &spr_read_generic
, &spr_write_generic
,
1724 /* Storage control */
1725 spr_register(env
, SPR_405_SLER
, "SLER",
1726 SPR_NOACCESS
, SPR_NOACCESS
,
1727 &spr_read_generic
, &spr_write_40x_sler
,
1729 spr_register(env
, SPR_40x_ZPR
, "ZPR",
1730 SPR_NOACCESS
, SPR_NOACCESS
,
1731 &spr_read_generic
, &spr_write_generic
,
1733 /* XXX : not implemented */
1734 spr_register(env
, SPR_405_SU0R
, "SU0R",
1735 SPR_NOACCESS
, SPR_NOACCESS
,
1736 &spr_read_generic
, &spr_write_generic
,
1739 spr_register(env
, SPR_USPRG0
, "USPRG0",
1740 &spr_read_ureg
, SPR_NOACCESS
,
1741 &spr_read_ureg
, SPR_NOACCESS
,
1743 spr_register(env
, SPR_SPRG4
, "SPRG4",
1744 SPR_NOACCESS
, SPR_NOACCESS
,
1745 &spr_read_generic
, &spr_write_generic
,
1747 spr_register(env
, SPR_USPRG4
, "USPRG4",
1748 &spr_read_ureg
, SPR_NOACCESS
,
1749 &spr_read_ureg
, SPR_NOACCESS
,
1751 spr_register(env
, SPR_SPRG5
, "SPRG5",
1752 SPR_NOACCESS
, SPR_NOACCESS
,
1753 spr_read_generic
, &spr_write_generic
,
1755 spr_register(env
, SPR_USPRG5
, "USPRG5",
1756 &spr_read_ureg
, SPR_NOACCESS
,
1757 &spr_read_ureg
, SPR_NOACCESS
,
1759 spr_register(env
, SPR_SPRG6
, "SPRG6",
1760 SPR_NOACCESS
, SPR_NOACCESS
,
1761 spr_read_generic
, &spr_write_generic
,
1763 spr_register(env
, SPR_USPRG6
, "USPRG6",
1764 &spr_read_ureg
, SPR_NOACCESS
,
1765 &spr_read_ureg
, SPR_NOACCESS
,
1767 spr_register(env
, SPR_SPRG7
, "SPRG7",
1768 SPR_NOACCESS
, SPR_NOACCESS
,
1769 spr_read_generic
, &spr_write_generic
,
1771 spr_register(env
, SPR_USPRG7
, "USPRG7",
1772 &spr_read_ureg
, SPR_NOACCESS
,
1773 &spr_read_ureg
, SPR_NOACCESS
,
1777 /* SPR shared between PowerPC 401 & 403 implementations */
1778 static void gen_spr_401_403 (CPUPPCState
*env
)
1781 spr_register(env
, SPR_403_VTBL
, "TBL",
1782 &spr_read_tbl
, SPR_NOACCESS
,
1783 &spr_read_tbl
, SPR_NOACCESS
,
1785 spr_register(env
, SPR_403_TBL
, "TBL",
1786 SPR_NOACCESS
, SPR_NOACCESS
,
1787 SPR_NOACCESS
, &spr_write_tbl
,
1789 spr_register(env
, SPR_403_VTBU
, "TBU",
1790 &spr_read_tbu
, SPR_NOACCESS
,
1791 &spr_read_tbu
, SPR_NOACCESS
,
1793 spr_register(env
, SPR_403_TBU
, "TBU",
1794 SPR_NOACCESS
, SPR_NOACCESS
,
1795 SPR_NOACCESS
, &spr_write_tbu
,
1798 /* XXX: not implemented */
1799 spr_register(env
, SPR_403_CDBCR
, "CDBCR",
1800 SPR_NOACCESS
, SPR_NOACCESS
,
1801 &spr_read_generic
, &spr_write_generic
,
1805 /* SPR specific to PowerPC 401 implementation */
1806 static void gen_spr_401 (CPUPPCState
*env
)
1808 /* Debug interface */
1809 /* XXX : not implemented */
1810 spr_register(env
, SPR_40x_DBCR0
, "DBCR",
1811 SPR_NOACCESS
, SPR_NOACCESS
,
1812 &spr_read_generic
, &spr_write_40x_dbcr0
,
1814 /* XXX : not implemented */
1815 spr_register(env
, SPR_40x_DBSR
, "DBSR",
1816 SPR_NOACCESS
, SPR_NOACCESS
,
1817 &spr_read_generic
, &spr_write_clear
,
1818 /* Last reset was system reset */
1820 /* XXX : not implemented */
1821 spr_register(env
, SPR_40x_DAC1
, "DAC",
1822 SPR_NOACCESS
, SPR_NOACCESS
,
1823 &spr_read_generic
, &spr_write_generic
,
1825 /* XXX : not implemented */
1826 spr_register(env
, SPR_40x_IAC1
, "IAC",
1827 SPR_NOACCESS
, SPR_NOACCESS
,
1828 &spr_read_generic
, &spr_write_generic
,
1830 /* Storage control */
1831 spr_register(env
, SPR_405_SLER
, "SLER",
1832 SPR_NOACCESS
, SPR_NOACCESS
,
1833 &spr_read_generic
, &spr_write_40x_sler
,
1837 /* SPR specific to PowerPC 403 implementation */
1838 static void gen_spr_403 (CPUPPCState
*env
)
1840 /* Debug interface */
1841 /* XXX : not implemented */
1842 spr_register(env
, SPR_40x_DBCR0
, "DBCR0",
1843 SPR_NOACCESS
, SPR_NOACCESS
,
1844 &spr_read_generic
, &spr_write_40x_dbcr0
,
1846 /* XXX : not implemented */
1847 spr_register(env
, SPR_40x_DBSR
, "DBSR",
1848 SPR_NOACCESS
, SPR_NOACCESS
,
1849 &spr_read_generic
, &spr_write_clear
,
1850 /* Last reset was system reset */
1852 /* XXX : not implemented */
1853 spr_register(env
, SPR_40x_DAC1
, "DAC1",
1854 SPR_NOACCESS
, SPR_NOACCESS
,
1855 &spr_read_generic
, &spr_write_generic
,
1857 spr_register(env
, SPR_40x_DAC2
, "DAC2",
1858 SPR_NOACCESS
, SPR_NOACCESS
,
1859 &spr_read_generic
, &spr_write_generic
,
1861 /* XXX : not implemented */
1862 spr_register(env
, SPR_40x_IAC1
, "IAC1",
1863 SPR_NOACCESS
, SPR_NOACCESS
,
1864 &spr_read_generic
, &spr_write_generic
,
1866 spr_register(env
, SPR_40x_IAC2
, "IAC2",
1867 SPR_NOACCESS
, SPR_NOACCESS
,
1868 &spr_read_generic
, &spr_write_generic
,
1871 spr_register(env
, SPR_40x_PID
, "PID",
1872 SPR_NOACCESS
, SPR_NOACCESS
,
1873 &spr_read_generic
, &spr_write_generic
,
1875 spr_register(env
, SPR_403_PBL1
, "PBL1",
1876 SPR_NOACCESS
, SPR_NOACCESS
,
1877 &spr_read_403_pbr
, &spr_write_403_pbr
,
1879 spr_register(env
, SPR_403_PBU1
, "PBU1",
1880 SPR_NOACCESS
, SPR_NOACCESS
,
1881 &spr_read_403_pbr
, &spr_write_403_pbr
,
1883 spr_register(env
, SPR_403_PBL2
, "PBL2",
1884 SPR_NOACCESS
, SPR_NOACCESS
,
1885 &spr_read_403_pbr
, &spr_write_403_pbr
,
1887 spr_register(env
, SPR_403_PBU2
, "PBU2",
1888 SPR_NOACCESS
, SPR_NOACCESS
,
1889 &spr_read_403_pbr
, &spr_write_403_pbr
,
1891 spr_register(env
, SPR_40x_ZPR
, "ZPR",
1892 SPR_NOACCESS
, SPR_NOACCESS
,
1893 &spr_read_generic
, &spr_write_generic
,
1897 /* SPR specific to PowerPC compression coprocessor extension */
1899 static void gen_spr_compress (CPUPPCState
*env
)
1901 spr_register(env
, SPR_401_SKR
, "SKR",
1902 SPR_NOACCESS
, SPR_NOACCESS
,
1903 &spr_read_generic
, &spr_write_generic
,
1910 * AMR => SPR 29 (Power 2.04)
1911 * CTRL => SPR 136 (Power 2.04)
1912 * CTRL => SPR 152 (Power 2.04)
1913 * VRSAVE => SPR 256 (Altivec)
1914 * SCOMC => SPR 276 (64 bits ?)
1915 * SCOMD => SPR 277 (64 bits ?)
1916 * ASR => SPR 280 (64 bits)
1917 * TBU40 => SPR 286 (Power 2.04 hypv)
1918 * HSPRG0 => SPR 304 (Power 2.04 hypv)
1919 * HSPRG1 => SPR 305 (Power 2.04 hypv)
1920 * HDSISR => SPR 306 (Power 2.04 hypv)
1921 * HDAR => SPR 307 (Power 2.04 hypv)
1922 * PURR => SPR 309 (Power 2.04 hypv)
1923 * HDEC => SPR 310 (Power 2.04 hypv)
1924 * HIOR => SPR 311 (hypv)
1925 * RMOR => SPR 312 (970)
1926 * HRMOR => SPR 313 (Power 2.04 hypv)
1927 * HSRR0 => SPR 314 (Power 2.04 hypv)
1928 * HSRR1 => SPR 315 (Power 2.04 hypv)
1929 * LPCR => SPR 316 (970)
1930 * LPIDR => SPR 317 (970)
1931 * SPEFSCR => SPR 512 (Power 2.04 emb)
1932 * ATBL => SPR 526 (Power 2.04 emb)
1933 * ATBU => SPR 527 (Power 2.04 emb)
1934 * EPR => SPR 702 (Power 2.04 emb)
1935 * perf => 768-783 (Power 2.04)
1936 * perf => 784-799 (Power 2.04)
1937 * PPR => SPR 896 (Power 2.04)
1938 * EPLC => SPR 947 (Power 2.04 emb)
1939 * EPSC => SPR 948 (Power 2.04 emb)
1940 * DABRX => 1015 (Power 2.04 hypv)
1941 * FPECR => SPR 1022 (?)
1942 * ... and more (thermal management, performance counters, ...)
1945 static void init_ppc_proc (CPUPPCState
*env
, ppc_def_t
*def
)
1948 /* Default MMU definitions */
1956 * - RCPU (same as MPC5xx ?)
1958 spr_register(env
, SPR_PVR
, "PVR",
1959 SPR_NOACCESS
, SPR_NOACCESS
,
1960 &spr_read_generic
, SPR_NOACCESS
,
1962 printf("%s: PVR %08x mask %08x => %08x\n", __func__
,
1963 def
->pvr
, def
->pvr_mask
, def
->pvr
& def
->pvr_mask
);
1965 /* Embedded PowerPC from IBM */
1966 case CPU_PPC_401A1
: /* 401 A1 family */
1967 case CPU_PPC_401B2
: /* 401 B2 family */
1969 case CPU_PPC_401B3
: /* 401 B3 family */
1971 case CPU_PPC_401C2
: /* 401 C2 family */
1972 case CPU_PPC_401D2
: /* 401 D2 family */
1973 case CPU_PPC_401E2
: /* 401 E2 family */
1974 case CPU_PPC_401F2
: /* 401 F2 family */
1975 case CPU_PPC_401G2
: /* 401 G2 family */
1976 case CPU_PPC_IOP480
: /* IOP 480 family */
1977 case CPU_PPC_COBRA
: /* IBM Processor for Network Resources */
1978 gen_spr_generic(env
);
1980 gen_spr_401_403(env
);
1983 /* XXX: optional ? */
1984 gen_spr_compress(env
);
1990 /* XXX: TODO: allocate internal IRQ controller */
1993 case CPU_PPC_403GA
: /* 403 GA family */
1994 case CPU_PPC_403GB
: /* 403 GB family */
1995 case CPU_PPC_403GC
: /* 403 GC family */
1996 case CPU_PPC_403GCX
: /* 403 GCX family */
1997 gen_spr_generic(env
);
1999 gen_spr_401_403(env
);
2005 /* XXX: TODO: allocate internal IRQ controller */
2008 case CPU_PPC_405CR
: /* 405 GP/CR family */
2009 case CPU_PPC_405EP
: /* 405 EP family */
2010 case CPU_PPC_405GPR
: /* 405 GPR family */
2011 case CPU_PPC_405D2
: /* 405 D2 family */
2012 case CPU_PPC_405D4
: /* 405 D4 family */
2013 gen_spr_generic(env
);
2022 /* Allocate hardware IRQ controller */
2023 ppc405_irq_init(env
);
2026 case CPU_PPC_NPE405H
: /* NPe405 H family */
2027 case CPU_PPC_NPE405H2
:
2028 case CPU_PPC_NPE405L
: /* Npe405 L family */
2029 gen_spr_generic(env
);
2038 /* Allocate hardware IRQ controller */
2039 ppc405_irq_init(env
);
2043 case CPU_PPC_STB01000
:
2046 case CPU_PPC_STB01010
:
2049 case CPU_PPC_STB0210
:
2051 case CPU_PPC_STB03
: /* STB03 family */
2053 case CPU_PPC_STB043
: /* STB043 family */
2056 case CPU_PPC_STB045
: /* STB045 family */
2058 case CPU_PPC_STB25
: /* STB25 family */
2060 case CPU_PPC_STB130
: /* STB130 family */
2062 gen_spr_generic(env
);
2071 /* Allocate hardware IRQ controller */
2072 ppc405_irq_init(env
);
2075 case CPU_PPC_440EP
: /* 440 EP family */
2076 case CPU_PPC_440GP
: /* 440 GP family */
2077 case CPU_PPC_440GX
: /* 440 GX family */
2078 case CPU_PPC_440GXc
: /* 440 GXc family */
2079 case CPU_PPC_440GXf
: /* 440 GXf family */
2080 case CPU_PPC_440SP
: /* 440 SP family */
2081 case CPU_PPC_440SP2
:
2082 case CPU_PPC_440SPE
: /* 440 SPE family */
2083 gen_spr_generic(env
);
2092 /* XXX: TODO: allocate internal IRQ controller */
2095 /* Embedded PowerPC from Freescale */
2101 case CPU_PPC_8xx
: /* MPC821 / 823 / 850 / 860 */
2105 case CPU_PPC_82xx_HIP3
: /* MPC8240 / 8260 */
2106 case CPU_PPC_82xx_HIP4
: /* MPC8240 / 8260 */
2110 case CPU_PPC_827x
: /* MPC 827x / 828x */
2114 /* XXX: Use MPC8540 PVR to implement a test PowerPC BookE target */
2115 case CPU_PPC_e500v110
:
2116 case CPU_PPC_e500v120
:
2117 case CPU_PPC_e500v210
:
2118 case CPU_PPC_e500v220
:
2119 gen_spr_generic(env
);
2123 gen_spr_BookE_FSL(env
);
2128 /* XXX: TODO: allocate internal IRQ controller */
2136 /* 32 bits PowerPC */
2137 case CPU_PPC_601
: /* PowerPC 601 */
2138 gen_spr_generic(env
);
2139 gen_spr_ne_601(env
);
2141 /* Hardware implementation registers */
2142 /* XXX : not implemented */
2143 spr_register(env
, SPR_HID0
, "HID0",
2144 SPR_NOACCESS
, SPR_NOACCESS
,
2145 &spr_read_generic
, &spr_write_generic
,
2147 /* XXX : not implemented */
2148 spr_register(env
, SPR_HID1
, "HID1",
2149 SPR_NOACCESS
, SPR_NOACCESS
,
2150 &spr_read_generic
, &spr_write_generic
,
2152 /* XXX : not implemented */
2153 spr_register(env
, SPR_601_HID2
, "HID2",
2154 SPR_NOACCESS
, SPR_NOACCESS
,
2155 &spr_read_generic
, &spr_write_generic
,
2157 /* XXX : not implemented */
2158 spr_register(env
, SPR_601_HID5
, "HID5",
2159 SPR_NOACCESS
, SPR_NOACCESS
,
2160 &spr_read_generic
, &spr_write_generic
,
2162 /* XXX : not implemented */
2164 spr_register(env
, SPR_601_HID15
, "HID15",
2165 SPR_NOACCESS
, SPR_NOACCESS
,
2166 &spr_read_generic
, &spr_write_generic
,
2173 /* XXX: TODO: allocate internal IRQ controller */
2176 case CPU_PPC_602
: /* PowerPC 602 */
2177 gen_spr_generic(env
);
2178 gen_spr_ne_601(env
);
2179 /* Memory management */
2183 gen_6xx_7xx_soft_tlb(env
, 64, 2);
2185 /* hardware implementation registers */
2186 /* XXX : not implemented */
2187 spr_register(env
, SPR_HID0
, "HID0",
2188 SPR_NOACCESS
, SPR_NOACCESS
,
2189 &spr_read_generic
, &spr_write_generic
,
2191 /* XXX : not implemented */
2192 spr_register(env
, SPR_HID1
, "HID1",
2193 SPR_NOACCESS
, SPR_NOACCESS
,
2194 &spr_read_generic
, &spr_write_generic
,
2196 /* Allocate hardware IRQ controller */
2197 ppc6xx_irq_init(env
);
2200 case CPU_PPC_603
: /* PowerPC 603 */
2201 case CPU_PPC_603E
: /* PowerPC 603e */
2202 case CPU_PPC_603E7v
:
2203 case CPU_PPC_603E7v2
:
2204 case CPU_PPC_603P
: /* PowerPC 603p */
2205 case CPU_PPC_603R
: /* PowerPC 603r */
2206 gen_spr_generic(env
);
2207 gen_spr_ne_601(env
);
2208 /* Memory management */
2212 gen_6xx_7xx_soft_tlb(env
, 64, 2);
2214 /* hardware implementation registers */
2215 /* XXX : not implemented */
2216 spr_register(env
, SPR_HID0
, "HID0",
2217 SPR_NOACCESS
, SPR_NOACCESS
,
2218 &spr_read_generic
, &spr_write_generic
,
2220 /* XXX : not implemented */
2221 spr_register(env
, SPR_HID1
, "HID1",
2222 SPR_NOACCESS
, SPR_NOACCESS
,
2223 &spr_read_generic
, &spr_write_generic
,
2225 /* Allocate hardware IRQ controller */
2226 ppc6xx_irq_init(env
);
2229 case CPU_PPC_G2
: /* PowerPC G2 family */
2233 case CPU_PPC_G2LE
: /* PowerPC G2LE family */
2234 case CPU_PPC_G2LEgp
:
2235 case CPU_PPC_G2LEls
:
2236 gen_spr_generic(env
);
2237 gen_spr_ne_601(env
);
2238 /* Memory management */
2242 /* Memory management */
2244 gen_6xx_7xx_soft_tlb(env
, 64, 2);
2245 gen_spr_G2_755(env
);
2247 /* Hardware implementation register */
2248 /* XXX : not implemented */
2249 spr_register(env
, SPR_HID0
, "HID0",
2250 SPR_NOACCESS
, SPR_NOACCESS
,
2251 &spr_read_generic
, &spr_write_generic
,
2253 /* XXX : not implemented */
2254 spr_register(env
, SPR_HID1
, "HID1",
2255 SPR_NOACCESS
, SPR_NOACCESS
,
2256 &spr_read_generic
, &spr_write_generic
,
2258 /* XXX : not implemented */
2259 spr_register(env
, SPR_HID2
, "HID2",
2260 SPR_NOACCESS
, SPR_NOACCESS
,
2261 &spr_read_generic
, &spr_write_generic
,
2263 /* Allocate hardware IRQ controller */
2264 ppc6xx_irq_init(env
);
2267 case CPU_PPC_604
: /* PowerPC 604 */
2268 case CPU_PPC_604E
: /* PowerPC 604e */
2269 case CPU_PPC_604R
: /* PowerPC 604r */
2270 gen_spr_generic(env
);
2271 gen_spr_ne_601(env
);
2272 /* Memory management */
2277 /* Hardware implementation registers */
2278 /* XXX : not implemented */
2279 spr_register(env
, SPR_HID0
, "HID0",
2280 SPR_NOACCESS
, SPR_NOACCESS
,
2281 &spr_read_generic
, &spr_write_generic
,
2283 /* XXX : not implemented */
2284 spr_register(env
, SPR_HID1
, "HID1",
2285 SPR_NOACCESS
, SPR_NOACCESS
,
2286 &spr_read_generic
, &spr_write_generic
,
2288 /* Allocate hardware IRQ controller */
2289 ppc6xx_irq_init(env
);
2292 case CPU_PPC_74x
: /* PowerPC 740 / 750 */
2295 case CPU_PPC_74xP
: /* PowerPC 740P / 750P */
2296 case CPU_PPC_750CXE21
: /* IBM PowerPC 750cxe */
2297 case CPU_PPC_750CXE22
:
2298 case CPU_PPC_750CXE23
:
2299 case CPU_PPC_750CXE24
:
2300 case CPU_PPC_750CXE24b
:
2301 case CPU_PPC_750CXE31
:
2302 case CPU_PPC_750CXE31b
:
2303 case CPU_PPC_750CXR
:
2304 gen_spr_generic(env
);
2305 gen_spr_ne_601(env
);
2306 /* Memory management */
2311 /* Hardware implementation registers */
2312 /* XXX : not implemented */
2313 spr_register(env
, SPR_HID0
, "HID0",
2314 SPR_NOACCESS
, SPR_NOACCESS
,
2315 &spr_read_generic
, &spr_write_generic
,
2317 /* XXX : not implemented */
2318 spr_register(env
, SPR_HID1
, "HID1",
2319 SPR_NOACCESS
, SPR_NOACCESS
,
2320 &spr_read_generic
, &spr_write_generic
,
2322 /* Allocate hardware IRQ controller */
2323 ppc6xx_irq_init(env
);
2326 case CPU_PPC_750FX10
: /* IBM PowerPC 750 FX */
2327 case CPU_PPC_750FX20
:
2328 case CPU_PPC_750FX21
:
2329 case CPU_PPC_750FX22
:
2330 case CPU_PPC_750FX23
:
2331 case CPU_PPC_750GX10
: /* IBM PowerPC 750 GX */
2332 case CPU_PPC_750GX11
:
2333 case CPU_PPC_750GX12
:
2334 gen_spr_generic(env
);
2335 gen_spr_ne_601(env
);
2336 /* Memory management */
2338 /* PowerPC 750fx & 750gx has 8 DBATs and 8 IBATs */
2343 /* Hardware implementation registers */
2344 /* XXX : not implemented */
2345 spr_register(env
, SPR_HID0
, "HID0",
2346 SPR_NOACCESS
, SPR_NOACCESS
,
2347 &spr_read_generic
, &spr_write_generic
,
2349 /* XXX : not implemented */
2350 spr_register(env
, SPR_HID1
, "HID1",
2351 SPR_NOACCESS
, SPR_NOACCESS
,
2352 &spr_read_generic
, &spr_write_generic
,
2354 /* XXX : not implemented */
2355 spr_register(env
, SPR_750_HID2
, "HID2",
2356 SPR_NOACCESS
, SPR_NOACCESS
,
2357 &spr_read_generic
, &spr_write_generic
,
2359 /* Allocate hardware IRQ controller */
2360 ppc6xx_irq_init(env
);
2363 case CPU_PPC_755_10
: /* PowerPC 755 */
2364 case CPU_PPC_755_11
:
2365 case CPU_PPC_755_20
:
2368 gen_spr_generic(env
);
2369 gen_spr_ne_601(env
);
2370 /* Memory management */
2374 /* Memory management */
2376 gen_6xx_7xx_soft_tlb(env
, 64, 2);
2377 gen_spr_G2_755(env
);
2378 /* L2 cache control */
2379 /* XXX : not implemented */
2380 spr_register(env
, SPR_ICTC
, "ICTC",
2381 SPR_NOACCESS
, SPR_NOACCESS
,
2382 &spr_read_generic
, &spr_write_generic
,
2384 /* XXX : not implemented */
2385 spr_register(env
, SPR_L2PM
, "L2PM",
2386 SPR_NOACCESS
, SPR_NOACCESS
,
2387 &spr_read_generic
, &spr_write_generic
,
2389 /* Hardware implementation registers */
2390 /* XXX : not implemented */
2391 spr_register(env
, SPR_HID0
, "HID0",
2392 SPR_NOACCESS
, SPR_NOACCESS
,
2393 &spr_read_generic
, &spr_write_generic
,
2395 /* XXX : not implemented */
2396 spr_register(env
, SPR_HID1
, "HID1",
2397 SPR_NOACCESS
, SPR_NOACCESS
,
2398 &spr_read_generic
, &spr_write_generic
,
2400 /* XXX : not implemented */
2401 spr_register(env
, SPR_HID2
, "HID2",
2402 SPR_NOACCESS
, SPR_NOACCESS
,
2403 &spr_read_generic
, &spr_write_generic
,
2405 /* Allocate hardware IRQ controller */
2406 ppc6xx_irq_init(env
);
2411 case CPU_PPC_7400
: /* PowerPC 7400 */
2412 case CPU_PPC_7410C
: /* PowerPC 7410 */
2415 case CPU_PPC_7441
: /* PowerPC 7441 */
2416 case CPU_PPC_7445
: /* PowerPC 7445 */
2417 case CPU_PPC_7447
: /* PowerPC 7447 */
2418 case CPU_PPC_7447A
: /* PowerPC 7447A */
2419 case CPU_PPC_7448
: /* PowerPC 7448 */
2420 case CPU_PPC_7450
: /* PowerPC 7450 */
2422 case CPU_PPC_7451
: /* PowerPC 7451 */
2424 case CPU_PPC_7455
: /* PowerPC 7455 */
2427 case CPU_PPC_7457
: /* PowerPC 7457 */
2429 case CPU_PPC_7457A
: /* PowerPC 7457A */
2433 /* 64 bits PowerPC */
2434 #if defined (TARGET_PPC64)
2436 case CPU_PPC_620
: /* PowerPC 620 */
2437 case CPU_PPC_630
: /* PowerPC 630 (Power 3) */
2438 case CPU_PPC_631
: /* PowerPC 631 (Power 3+) */
2439 case CPU_PPC_POWER4
: /* Power 4 */
2440 case CPU_PPC_POWER4P
: /* Power 4+ */
2441 case CPU_PPC_POWER5
: /* Power 5 */
2442 case CPU_PPC_POWER5P
: /* Power 5+ */
2446 case CPU_PPC_970
: /* PowerPC 970 */
2447 case CPU_PPC_970FX10
: /* PowerPC 970 FX */
2448 case CPU_PPC_970FX20
:
2449 case CPU_PPC_970FX21
:
2450 case CPU_PPC_970FX30
:
2451 case CPU_PPC_970FX31
:
2452 case CPU_PPC_970MP10
: /* PowerPC 970 MP */
2453 case CPU_PPC_970MP11
:
2454 gen_spr_generic(env
);
2455 gen_spr_ne_601(env
);
2456 /* XXX: not correct */
2461 /* Hardware implementation registers */
2462 /* XXX : not implemented */
2463 spr_register(env
, SPR_HID0
, "HID0",
2464 SPR_NOACCESS
, SPR_NOACCESS
,
2465 &spr_read_generic
, &spr_write_generic
,
2467 /* XXX : not implemented */
2468 spr_register(env
, SPR_HID1
, "HID1",
2469 SPR_NOACCESS
, SPR_NOACCESS
,
2470 &spr_read_generic
, &spr_write_generic
,
2472 /* XXX : not implemented */
2473 spr_register(env
, SPR_750_HID2
, "HID2",
2474 SPR_NOACCESS
, SPR_NOACCESS
,
2475 &spr_read_generic
, &spr_write_generic
,
2477 /* Allocate hardware IRQ controller */
2478 ppc970_irq_init(env
);
2482 case CPU_PPC_CELL10
: /* Cell family */
2483 case CPU_PPC_CELL20
:
2484 case CPU_PPC_CELL30
:
2485 case CPU_PPC_CELL31
:
2490 case CPU_PPC_RS64
: /* Apache (RS64/A35) */
2491 case CPU_PPC_RS64II
: /* NorthStar (RS64-II/A50) */
2492 case CPU_PPC_RS64III
: /* Pulsar (RS64-III) */
2493 case CPU_PPC_RS64IV
: /* IceStar/IStar/SStar (RS64-IV) */
2496 #endif /* defined (TARGET_PPC64) */
2500 case CPU_POWER
: /* POWER */
2501 case CPU_POWER2
: /* POWER2 */
2506 gen_spr_generic(env
);
2507 /* XXX: TODO: allocate internal IRQ controller */
2510 if (env
->nb_BATs
== -1)
2512 /* Allocate TLBs buffer when needed */
2513 if (env
->nb_tlb
!= 0) {
2514 int nb_tlb
= env
->nb_tlb
;
2515 if (env
->id_tlbs
!= 0)
2517 env
->tlb
= qemu_mallocz(nb_tlb
* sizeof(ppc_tlb_t
));
2518 /* Pre-compute some useful values */
2519 env
->tlb_per_way
= env
->nb_tlb
/ env
->nb_ways
;
2523 #if defined(PPC_DUMP_CPU)
2524 static void dump_sprs (CPUPPCState
*env
)
2527 uint32_t pvr
= env
->spr
[SPR_PVR
];
2528 uint32_t sr
, sw
, ur
, uw
;
2531 printf("* SPRs for PVR=%08x\n", pvr
);
2532 for (i
= 0; i
< 32; i
++) {
2533 for (j
= 0; j
< 32; j
++) {
2535 spr
= &env
->spr_cb
[n
];
2536 #if !defined(CONFIG_USER_ONLY)
2537 sw
= spr
->oea_write
!= NULL
&& spr
->oea_write
!= SPR_NOACCESS
;
2538 sr
= spr
->oea_read
!= NULL
&& spr
->oea_read
!= SPR_NOACCESS
;
2543 uw
= spr
->uea_write
!= NULL
&& spr
->uea_write
!= SPR_NOACCESS
;
2544 ur
= spr
->uea_read
!= NULL
&& spr
->uea_read
!= SPR_NOACCESS
;
2545 if (sw
|| sr
|| uw
|| ur
) {
2546 printf("SPR: %4d (%03x) %-8s s%c%c u%c%c\n",
2547 (i
<< 5) | j
, (i
<< 5) | j
, spr
->name
,
2548 sw
? 'w' : '-', sr
? 'r' : '-',
2549 uw
? 'w' : '-', ur
? 'r' : '-');
2558 /*****************************************************************************/
2562 int fflush (FILE *stream
);
2566 PPC_DIRECT
= 0, /* Opcode routine */
2567 PPC_INDIRECT
= 1, /* Indirect opcode table */
2570 static inline int is_indirect_opcode (void *handler
)
2572 return ((unsigned long)handler
& 0x03) == PPC_INDIRECT
;
2575 static inline opc_handler_t
**ind_table(void *handler
)
2577 return (opc_handler_t
**)((unsigned long)handler
& ~3);
2580 /* Instruction table creation */
2581 /* Opcodes tables creation */
2582 static void fill_new_table (opc_handler_t
**table
, int len
)
2586 for (i
= 0; i
< len
; i
++)
2587 table
[i
] = &invalid_handler
;
2590 static int create_new_table (opc_handler_t
**table
, unsigned char idx
)
2592 opc_handler_t
**tmp
;
2594 tmp
= malloc(0x20 * sizeof(opc_handler_t
));
2597 fill_new_table(tmp
, 0x20);
2598 table
[idx
] = (opc_handler_t
*)((unsigned long)tmp
| PPC_INDIRECT
);
2603 static int insert_in_table (opc_handler_t
**table
, unsigned char idx
,
2604 opc_handler_t
*handler
)
2606 if (table
[idx
] != &invalid_handler
)
2608 table
[idx
] = handler
;
2613 static int register_direct_insn (opc_handler_t
**ppc_opcodes
,
2614 unsigned char idx
, opc_handler_t
*handler
)
2616 if (insert_in_table(ppc_opcodes
, idx
, handler
) < 0) {
2617 printf("*** ERROR: opcode %02x already assigned in main "
2618 "opcode table\n", idx
);
2625 static int register_ind_in_table (opc_handler_t
**table
,
2626 unsigned char idx1
, unsigned char idx2
,
2627 opc_handler_t
*handler
)
2629 if (table
[idx1
] == &invalid_handler
) {
2630 if (create_new_table(table
, idx1
) < 0) {
2631 printf("*** ERROR: unable to create indirect table "
2632 "idx=%02x\n", idx1
);
2636 if (!is_indirect_opcode(table
[idx1
])) {
2637 printf("*** ERROR: idx %02x already assigned to a direct "
2642 if (handler
!= NULL
&&
2643 insert_in_table(ind_table(table
[idx1
]), idx2
, handler
) < 0) {
2644 printf("*** ERROR: opcode %02x already assigned in "
2645 "opcode table %02x\n", idx2
, idx1
);
2652 static int register_ind_insn (opc_handler_t
**ppc_opcodes
,
2653 unsigned char idx1
, unsigned char idx2
,
2654 opc_handler_t
*handler
)
2658 ret
= register_ind_in_table(ppc_opcodes
, idx1
, idx2
, handler
);
2663 static int register_dblind_insn (opc_handler_t
**ppc_opcodes
,
2664 unsigned char idx1
, unsigned char idx2
,
2665 unsigned char idx3
, opc_handler_t
*handler
)
2667 if (register_ind_in_table(ppc_opcodes
, idx1
, idx2
, NULL
) < 0) {
2668 printf("*** ERROR: unable to join indirect table idx "
2669 "[%02x-%02x]\n", idx1
, idx2
);
2672 if (register_ind_in_table(ind_table(ppc_opcodes
[idx1
]), idx2
, idx3
,
2674 printf("*** ERROR: unable to insert opcode "
2675 "[%02x-%02x-%02x]\n", idx1
, idx2
, idx3
);
2682 static int register_insn (opc_handler_t
**ppc_opcodes
, opcode_t
*insn
)
2684 if (insn
->opc2
!= 0xFF) {
2685 if (insn
->opc3
!= 0xFF) {
2686 if (register_dblind_insn(ppc_opcodes
, insn
->opc1
, insn
->opc2
,
2687 insn
->opc3
, &insn
->handler
) < 0)
2690 if (register_ind_insn(ppc_opcodes
, insn
->opc1
,
2691 insn
->opc2
, &insn
->handler
) < 0)
2695 if (register_direct_insn(ppc_opcodes
, insn
->opc1
, &insn
->handler
) < 0)
2702 static int test_opcode_table (opc_handler_t
**table
, int len
)
2706 for (i
= 0, count
= 0; i
< len
; i
++) {
2707 /* Consistency fixup */
2708 if (table
[i
] == NULL
)
2709 table
[i
] = &invalid_handler
;
2710 if (table
[i
] != &invalid_handler
) {
2711 if (is_indirect_opcode(table
[i
])) {
2712 tmp
= test_opcode_table(ind_table(table
[i
]), 0x20);
2715 table
[i
] = &invalid_handler
;
2728 static void fix_opcode_tables (opc_handler_t
**ppc_opcodes
)
2730 if (test_opcode_table(ppc_opcodes
, 0x40) == 0)
2731 printf("*** WARNING: no opcode defined !\n");
2734 /*****************************************************************************/
2735 static int create_ppc_opcodes (CPUPPCState
*env
, ppc_def_t
*def
)
2737 opcode_t
*opc
, *start
, *end
;
2739 fill_new_table(env
->opcodes
, 0x40);
2740 #if defined(PPC_DUMP_CPU)
2741 printf("* PowerPC instructions for PVR %08x: %s flags %016" PRIx64
2743 def
->pvr
, def
->name
, def
->insns_flags
, def
->flags
);
2745 if (&opc_start
< &opc_end
) {
2752 for (opc
= start
+ 1; opc
!= end
; opc
++) {
2753 if ((opc
->handler
.type
& def
->insns_flags
) != 0) {
2754 if (register_insn(env
->opcodes
, opc
) < 0) {
2755 printf("*** ERROR initializing PowerPC instruction "
2756 "0x%02x 0x%02x 0x%02x\n", opc
->opc1
, opc
->opc2
,
2760 #if defined(PPC_DUMP_CPU)
2762 if (opc
->opc3
== 0xFF) {
2763 if (opc
->opc2
== 0xFF) {
2764 printf("INSN: %02x -- -- (%02d ----) : %s\n",
2765 opc
->opc1
, opc
->opc1
, opc
->oname
);
2767 printf("INSN: %02x %02x -- (%02d %04d) : %s\n",
2768 opc
->opc1
, opc
->opc2
, opc
->opc1
, opc
->opc2
,
2772 printf("INSN: %02x %02x %02x (%02d %04d) : %s\n",
2773 opc
->opc1
, opc
->opc2
, opc
->opc3
,
2774 opc
->opc1
, (opc
->opc3
<< 5) | opc
->opc2
,
2781 fix_opcode_tables(env
->opcodes
);
2788 int cpu_ppc_register (CPUPPCState
*env
, ppc_def_t
*def
)
2790 env
->msr_mask
= def
->msr_mask
;
2791 env
->flags
= def
->flags
;
2792 if (create_ppc_opcodes(env
, def
) < 0)
2794 init_ppc_proc(env
, def
);
2795 #if defined(PPC_DUMP_CPU)
2797 if (env
->tlb
!= NULL
) {
2798 printf("%d %s TLB in %d ways\n", env
->nb_tlb
,
2799 env
->id_tlbs
? "splitted" : "merged", env
->nb_ways
);
2806 /*****************************************************************************/
2807 /* PowerPC CPU definitions */
2808 static ppc_def_t ppc_defs
[] = {
2809 /* Embedded PowerPC */
2810 /* Generic PowerPC 401 */
2814 .pvr_mask
= 0xFFFFFFFF,
2815 .insns_flags
= PPC_INSNS_401
,
2816 .flags
= PPC_FLAGS_401
,
2817 .msr_mask
= 0x000FD201,
2822 .pvr
= CPU_PPC_401A1
,
2823 .pvr_mask
= 0xFFFFFFFF,
2824 .insns_flags
= PPC_INSNS_401
,
2825 .flags
= PPC_FLAGS_401
,
2826 .msr_mask
= 0x000FD201,
2831 .pvr
= CPU_PPC_401B2
,
2832 .pvr_mask
= 0xFFFFFFFF,
2833 .insns_flags
= PPC_INSNS_401
,
2834 .flags
= PPC_FLAGS_401
,
2835 .msr_mask
= 0x000FD201,
2841 .pvr
= CPU_PPC_401B3
,
2842 .pvr_mask
= 0xFFFFFFFF,
2843 .insns_flags
= PPC_INSNS_401
,
2844 .flags
= PPC_FLAGS_401
,
2845 .msr_mask
= 0x000FD201,
2851 .pvr
= CPU_PPC_401C2
,
2852 .pvr_mask
= 0xFFFFFFFF,
2853 .insns_flags
= PPC_INSNS_401
,
2854 .flags
= PPC_FLAGS_401
,
2855 .msr_mask
= 0x000FD201,
2860 .pvr
= CPU_PPC_401D2
,
2861 .pvr_mask
= 0xFFFFFFFF,
2862 .insns_flags
= PPC_INSNS_401
,
2863 .flags
= PPC_FLAGS_401
,
2864 .msr_mask
= 0x000FD201,
2869 .pvr
= CPU_PPC_401E2
,
2870 .pvr_mask
= 0xFFFFFFFF,
2871 .insns_flags
= PPC_INSNS_401
,
2872 .flags
= PPC_FLAGS_401
,
2873 .msr_mask
= 0x000FD201,
2878 .pvr
= CPU_PPC_401F2
,
2879 .pvr_mask
= 0xFFFFFFFF,
2880 .insns_flags
= PPC_INSNS_401
,
2881 .flags
= PPC_FLAGS_401
,
2882 .msr_mask
= 0x000FD201,
2887 .pvr
= CPU_PPC_401G2
,
2888 .pvr_mask
= 0xFFFFFFFF,
2889 .insns_flags
= PPC_INSNS_401
,
2890 .flags
= PPC_FLAGS_401
,
2891 .msr_mask
= 0x000FD201,
2897 .pvr
= CPU_PPC_401GF
,
2898 .pvr_mask
= 0xFFFFFFFF,
2899 .insns_flags
= PPC_INSNS_401
,
2900 .flags
= PPC_FLAGS_401
,
2901 .msr_mask
= 0x000FD201,
2905 /* IOP480 (401 microcontroler) */
2908 .pvr
= CPU_PPC_IOP480
,
2909 .pvr_mask
= 0xFFFFFFFF,
2910 .insns_flags
= PPC_INSNS_401
,
2911 .flags
= PPC_FLAGS_401
,
2912 .msr_mask
= 0x000FD201,
2916 /* IBM Processor for Network Resources */
2919 .pvr
= CPU_PPC_COBRA
,
2920 .pvr_mask
= 0xFFFFFFFF,
2921 .insns_flags
= PPC_INSNS_401
,
2922 .flags
= PPC_FLAGS_401
,
2923 .msr_mask
= 0x000FD201,
2926 /* Generic PowerPC 403 */
2930 .pvr_mask
= 0xFFFFFFFF,
2931 .insns_flags
= PPC_INSNS_403
,
2932 .flags
= PPC_FLAGS_403
,
2933 .msr_mask
= 0x000000000007D23DULL
,
2935 /* PowerPC 403 GA */
2938 .pvr
= CPU_PPC_403GA
,
2939 .pvr_mask
= 0xFFFFFFFF,
2940 .insns_flags
= PPC_INSNS_403
,
2941 .flags
= PPC_FLAGS_403
,
2942 .msr_mask
= 0x000000000007D23DULL
,
2944 /* PowerPC 403 GB */
2947 .pvr
= CPU_PPC_403GB
,
2948 .pvr_mask
= 0xFFFFFFFF,
2949 .insns_flags
= PPC_INSNS_403
,
2950 .flags
= PPC_FLAGS_403
,
2951 .msr_mask
= 0x000000000007D23DULL
,
2953 /* PowerPC 403 GC */
2956 .pvr
= CPU_PPC_403GC
,
2957 .pvr_mask
= 0xFFFFFFFF,
2958 .insns_flags
= PPC_INSNS_403
,
2959 .flags
= PPC_FLAGS_403
,
2960 .msr_mask
= 0x000000000007D23DULL
,
2962 /* PowerPC 403 GCX */
2965 .pvr
= CPU_PPC_403GCX
,
2966 .pvr_mask
= 0xFFFFFFFF,
2967 .insns_flags
= PPC_INSNS_403
,
2968 .flags
= PPC_FLAGS_403
,
2969 .msr_mask
= 0x000000000007D23DULL
,
2972 /* PowerPC 403 GP */
2975 .pvr
= CPU_PPC_403GP
,
2976 .pvr_mask
= 0xFFFFFFFF,
2977 .insns_flags
= PPC_INSNS_403
,
2978 .flags
= PPC_FLAGS_403
,
2979 .msr_mask
= 0x000000000007D23DULL
,
2982 /* Generic PowerPC 405 */
2986 .pvr_mask
= 0xFFFFFFFF,
2987 .insns_flags
= PPC_INSNS_405
,
2988 .flags
= PPC_FLAGS_405
,
2989 .msr_mask
= 0x00000000020EFF30ULL
,
2992 /* PowerPC 405 A3 */
2995 .pvr
= CPU_PPC_405A3
,
2996 .pvr_mask
= 0xFFFFFFFF,
2997 .insns_flags
= PPC_INSNS_405
,
2998 .flags
= PPC_FLAGS_405
,
2999 .msr_mask
= 0x00000000020EFF30ULL
,
3003 /* PowerPC 405 A4 */
3006 .pvr
= CPU_PPC_405A4
,
3007 .pvr_mask
= 0xFFFFFFFF,
3008 .insns_flags
= PPC_INSNS_405
,
3009 .flags
= PPC_FLAGS_405
,
3010 .msr_mask
= 0x00000000020EFF30ULL
,
3014 /* PowerPC 405 B3 */
3017 .pvr
= CPU_PPC_405B3
,
3018 .pvr_mask
= 0xFFFFFFFF,
3019 .insns_flags
= PPC_INSNS_405
,
3020 .flags
= PPC_FLAGS_405
,
3021 .msr_mask
= 0x00000000020EFF30ULL
,
3024 /* PowerPC 405 D2 */
3027 .pvr
= CPU_PPC_405D2
,
3028 .pvr_mask
= 0xFFFFFFFF,
3029 .insns_flags
= PPC_INSNS_405
,
3030 .flags
= PPC_FLAGS_405
,
3031 .msr_mask
= 0x00000000020EFF30ULL
,
3033 /* PowerPC 405 D4 */
3036 .pvr
= CPU_PPC_405D4
,
3037 .pvr_mask
= 0xFFFFFFFF,
3038 .insns_flags
= PPC_INSNS_405
,
3039 .flags
= PPC_FLAGS_405
,
3040 .msr_mask
= 0x00000000020EFF30ULL
,
3042 /* PowerPC 405 CR */
3045 .pvr
= CPU_PPC_405CR
,
3046 .pvr_mask
= 0xFFFFFFFF,
3047 .insns_flags
= PPC_INSNS_405
,
3048 .flags
= PPC_FLAGS_405
,
3049 .msr_mask
= 0x00000000020EFF30ULL
,
3051 /* PowerPC 405 GP */
3054 .pvr
= CPU_PPC_405GP
,
3055 .pvr_mask
= 0xFFFFFFFF,
3056 .insns_flags
= PPC_INSNS_405
,
3057 .flags
= PPC_FLAGS_405
,
3058 .msr_mask
= 0x00000000020EFF30ULL
,
3060 /* PowerPC 405 EP */
3063 .pvr
= CPU_PPC_405EP
,
3064 .pvr_mask
= 0xFFFFFFFF,
3065 .insns_flags
= PPC_INSNS_405
,
3066 .flags
= PPC_FLAGS_405
,
3067 .msr_mask
= 0x00000000000ED630ULL
,
3070 /* PowerPC 405 EZ */
3073 .pvr
= CPU_PPC_405EZ
,
3074 .pvr_mask
= 0xFFFFFFFF,
3075 .insns_flags
= PPC_INSNS_405
,
3076 .flags
= PPC_FLAGS_405
,
3077 .msr_mask
= 0x00000000020EFF30ULL
,
3081 /* PowerPC 405 GPR */
3084 .pvr
= CPU_PPC_405GPR
,
3085 .pvr_mask
= 0xFFFFFFFF,
3086 .insns_flags
= PPC_INSNS_405
,
3087 .flags
= PPC_FLAGS_405
,
3088 .msr_mask
= 0x00000000020EFF30ULL
,
3092 /* PowerPC 405 LP */
3095 .pvr
= CPU_PPC_405EZ
,
3096 .pvr_mask
= 0xFFFFFFFF,
3097 .insns_flags
= PPC_INSNS_405
,
3098 .flags
= PPC_FLAGS_405
,
3099 .msr_mask
= 0x00000000020EFF30ULL
,
3105 .pvr
= CPU_PPC_NPE405H
,
3106 .pvr_mask
= 0xFFFFFFFF,
3107 .insns_flags
= PPC_INSNS_405
,
3108 .flags
= PPC_FLAGS_405
,
3109 .msr_mask
= 0x00000000020EFF30ULL
,
3114 .pvr
= CPU_PPC_NPE405H2
,
3115 .pvr_mask
= 0xFFFFFFFF,
3116 .insns_flags
= PPC_INSNS_405
,
3117 .flags
= PPC_FLAGS_405
,
3118 .msr_mask
= 0x00000000020EFF30ULL
,
3123 .pvr
= CPU_PPC_NPE405L
,
3124 .pvr_mask
= 0xFFFFFFFF,
3125 .insns_flags
= PPC_INSNS_405
,
3126 .flags
= PPC_FLAGS_405
,
3127 .msr_mask
= 0x00000000020EFF30ULL
,
3130 /* PowerPC LP777000 */
3133 .pvr
= CPU_PPC_LP777000
,
3134 .pvr_mask
= 0xFFFFFFFF,
3135 .insns_flags
= PPC_INSNS_405
,
3136 .flags
= PPC_FLAGS_405
,
3137 .msr_mask
= 0x00000000020EFF30ULL
,
3144 .pvr
= CPU_PPC_STB01000
,
3145 .pvr_mask
= 0xFFFFFFFF,
3146 .insns_flags
= PPC_INSNS_405
,
3147 .flags
= PPC_FLAGS_405
,
3148 .msr_mask
= 0x00000000020EFF30ULL
,
3155 .pvr
= CPU_PPC_STB01010
,
3156 .pvr_mask
= 0xFFFFFFFF,
3157 .insns_flags
= PPC_INSNS_405
,
3158 .flags
= PPC_FLAGS_405
,
3159 .msr_mask
= 0x00000000020EFF30ULL
,
3166 .pvr
= CPU_PPC_STB0210
,
3167 .pvr_mask
= 0xFFFFFFFF,
3168 .insns_flags
= PPC_INSNS_405
,
3169 .flags
= PPC_FLAGS_405
,
3170 .msr_mask
= 0x00000000020EFF30ULL
,
3177 .pvr
= CPU_PPC_STB03
,
3178 .pvr_mask
= 0xFFFFFFFF,
3179 .insns_flags
= PPC_INSNS_405
,
3180 .flags
= PPC_FLAGS_405
,
3181 .msr_mask
= 0x00000000020EFF30ULL
,
3188 .pvr
= CPU_PPC_STB043
,
3189 .pvr_mask
= 0xFFFFFFFF,
3190 .insns_flags
= PPC_INSNS_405
,
3191 .flags
= PPC_FLAGS_405
,
3192 .msr_mask
= 0x00000000020EFF30ULL
,
3199 .pvr
= CPU_PPC_STB045
,
3200 .pvr_mask
= 0xFFFFFFFF,
3201 .insns_flags
= PPC_INSNS_405
,
3202 .flags
= PPC_FLAGS_405
,
3203 .msr_mask
= 0x00000000020EFF30ULL
,
3206 #if defined (TODO) || 1
3210 .pvr
= CPU_PPC_STB25
,
3211 .pvr_mask
= 0xFFFFFFFF,
3212 .insns_flags
= PPC_INSNS_405
,
3213 .flags
= PPC_FLAGS_405
,
3214 .msr_mask
= 0x00000000020EFF30ULL
,
3221 .pvr
= CPU_PPC_STB130
,
3222 .pvr_mask
= 0xFFFFFFFF,
3223 .insns_flags
= PPC_INSNS_405
,
3224 .flags
= PPC_FLAGS_405
,
3225 .msr_mask
= 0x00000000020EFF30ULL
,
3228 /* Xilinx PowerPC 405 cores */
3232 .pvr
= CPU_PPC_X2VP4
,
3233 .pvr_mask
= 0xFFFFFFFF,
3234 .insns_flags
= PPC_INSNS_405
,
3235 .flags
= PPC_FLAGS_405
,
3236 .msr_mask
= 0x00000000020EFF30ULL
,
3240 .pvr
= CPU_PPC_X2VP7
,
3241 .pvr_mask
= 0xFFFFFFFF,
3242 .insns_flags
= PPC_INSNS_405
,
3243 .flags
= PPC_FLAGS_405
,
3244 .msr_mask
= 0x00000000020EFF30ULL
,
3248 .pvr
= CPU_PPC_X2VP20
,
3249 .pvr_mask
= 0xFFFFFFFF,
3250 .insns_flags
= PPC_INSNS_405
,
3251 .flags
= PPC_FLAGS_405
,
3252 .msr_mask
= 0x00000000020EFF30ULL
,
3256 .pvr
= CPU_PPC_X2VP50
,
3257 .pvr_mask
= 0xFFFFFFFF,
3258 .insns_flags
= PPC_INSNS_405
,
3259 .flags
= PPC_FLAGS_405
,
3260 .msr_mask
= 0x00000000020EFF30ULL
,
3263 /* PowerPC 440 EP */
3266 .pvr
= CPU_PPC_440EP
,
3267 .pvr_mask
= 0xFFFFFFFF,
3268 .insns_flags
= PPC_INSNS_440
,
3269 .flags
= PPC_FLAGS_440
,
3270 .msr_mask
= 0x000000000006D630ULL
,
3272 /* PowerPC 440 GR */
3275 .pvr
= CPU_PPC_440GR
,
3276 .pvr_mask
= 0xFFFFFFFF,
3277 .insns_flags
= PPC_INSNS_440
,
3278 .flags
= PPC_FLAGS_440
,
3279 .msr_mask
= 0x000000000006D630ULL
,
3281 /* PowerPC 440 GP */
3284 .pvr
= CPU_PPC_440GP
,
3285 .pvr_mask
= 0xFFFFFFFF,
3286 .insns_flags
= PPC_INSNS_440
,
3287 .flags
= PPC_FLAGS_440
,
3288 .msr_mask
= 0x000000000006D630ULL
,
3291 /* PowerPC 440 GRX */
3294 .pvr
= CPU_PPC_440GRX
,
3295 .pvr_mask
= 0xFFFFFFFF,
3296 .insns_flags
= PPC_INSNS_440
,
3297 .flags
= PPC_FLAGS_440
,
3298 .msr_mask
= 0x000000000006D630ULL
,
3301 /* PowerPC 440 GX */
3304 .pvr
= CPU_PPC_440GX
,
3305 .pvr_mask
= 0xFFFFFFFF,
3306 .insns_flags
= PPC_INSNS_440
,
3307 .flags
= PPC_FLAGS_440
,
3308 .msr_mask
= 0x000000000006D630ULL
,
3310 /* PowerPC 440 GXc */
3313 .pvr
= CPU_PPC_440GXc
,
3314 .pvr_mask
= 0xFFFFFFFF,
3315 .insns_flags
= PPC_INSNS_440
,
3316 .flags
= PPC_FLAGS_440
,
3317 .msr_mask
= 0x000000000006D630ULL
,
3319 /* PowerPC 440 GXf */
3322 .pvr
= CPU_PPC_440GXf
,
3323 .pvr_mask
= 0xFFFFFFFF,
3324 .insns_flags
= PPC_INSNS_440
,
3325 .flags
= PPC_FLAGS_440
,
3326 .msr_mask
= 0x000000000006D630ULL
,
3328 /* PowerPC 440 SP */
3331 .pvr
= CPU_PPC_440SP
,
3332 .pvr_mask
= 0xFFFFFFFF,
3333 .insns_flags
= PPC_INSNS_440
,
3334 .flags
= PPC_FLAGS_440
,
3335 .msr_mask
= 0x000000000006D630ULL
,
3337 /* PowerPC 440 SP2 */
3340 .pvr
= CPU_PPC_440SP2
,
3341 .pvr_mask
= 0xFFFFFFFF,
3342 .insns_flags
= PPC_INSNS_440
,
3343 .flags
= PPC_FLAGS_440
,
3344 .msr_mask
= 0x000000000006D630ULL
,
3346 /* PowerPC 440 SPE */
3349 .pvr
= CPU_PPC_440SPE
,
3350 .pvr_mask
= 0xFFFFFFFF,
3351 .insns_flags
= PPC_INSNS_440
,
3352 .flags
= PPC_FLAGS_440
,
3353 .msr_mask
= 0x000000000006D630ULL
,
3355 /* Fake generic BookE PowerPC */
3358 .pvr
= CPU_PPC_e500
,
3359 .pvr_mask
= 0xFFFFFFFF,
3360 .insns_flags
= PPC_INSNS_BOOKE
,
3361 .flags
= PPC_FLAGS_BOOKE
,
3362 .msr_mask
= 0x000000000006D630ULL
,
3364 /* PowerPC 460 cores - TODO */
3365 /* PowerPC MPC 5xx cores - TODO */
3366 /* PowerPC MPC 8xx cores - TODO */
3367 /* PowerPC MPC 8xxx cores - TODO */
3368 /* e200 cores - TODO */
3369 /* e500 cores - TODO */
3370 /* e600 cores - TODO */
3372 /* 32 bits "classic" PowerPC */
3378 .pvr_mask
= 0xFFFFFFFF,
3379 .insns_flags
= PPC_INSNS_601
,
3380 .flags
= PPC_FLAGS_601
,
3381 .msr_mask
= 0x000000000000FD70ULL
,
3389 .pvr_mask
= 0xFFFFFFFF,
3390 .insns_flags
= PPC_INSNS_602
,
3391 .flags
= PPC_FLAGS_602
,
3392 .msr_mask
= 0x0000000000C7FF73ULL
,
3399 .pvr_mask
= 0xFFFFFFFF,
3400 .insns_flags
= PPC_INSNS_603
,
3401 .flags
= PPC_FLAGS_603
,
3402 .msr_mask
= 0x000000000007FF73ULL
,
3407 .pvr
= CPU_PPC_603E
,
3408 .pvr_mask
= 0xFFFFFFFF,
3409 .insns_flags
= PPC_INSNS_603
,
3410 .flags
= PPC_FLAGS_603
,
3411 .msr_mask
= 0x000000000007FF73ULL
,
3415 .pvr
= CPU_PPC_603E
,
3416 .pvr_mask
= 0xFFFFFFFF,
3417 .insns_flags
= PPC_INSNS_603
,
3418 .flags
= PPC_FLAGS_603
,
3419 .msr_mask
= 0x000000000007FF73ULL
,
3424 .pvr
= CPU_PPC_603P
,
3425 .pvr_mask
= 0xFFFFFFFF,
3426 .insns_flags
= PPC_INSNS_603
,
3427 .flags
= PPC_FLAGS_603
,
3428 .msr_mask
= 0x000000000007FF73ULL
,
3433 .pvr
= CPU_PPC_603E7
,
3434 .pvr_mask
= 0xFFFFFFFF,
3435 .insns_flags
= PPC_INSNS_603
,
3436 .flags
= PPC_FLAGS_603
,
3437 .msr_mask
= 0x000000000007FF73ULL
,
3439 /* PowerPC 603e7v */
3442 .pvr
= CPU_PPC_603E7v
,
3443 .pvr_mask
= 0xFFFFFFFF,
3444 .insns_flags
= PPC_INSNS_603
,
3445 .flags
= PPC_FLAGS_603
,
3446 .msr_mask
= 0x000000000007FF73ULL
,
3448 /* PowerPC 603e7v2 */
3451 .pvr
= CPU_PPC_603E7v2
,
3452 .pvr_mask
= 0xFFFFFFFF,
3453 .insns_flags
= PPC_INSNS_603
,
3454 .flags
= PPC_FLAGS_603
,
3455 .msr_mask
= 0x000000000007FF73ULL
,
3460 .pvr
= CPU_PPC_603R
,
3461 .pvr_mask
= 0xFFFFFFFF,
3462 .insns_flags
= PPC_INSNS_603
,
3463 .flags
= PPC_FLAGS_603
,
3464 .msr_mask
= 0x000000000007FF73ULL
,
3467 .name
= "Goldeneye",
3468 .pvr
= CPU_PPC_603R
,
3469 .pvr_mask
= 0xFFFFFFFF,
3470 .insns_flags
= PPC_INSNS_603
,
3471 .flags
= PPC_FLAGS_603
,
3472 .msr_mask
= 0x000000000007FF73ULL
,
3475 /* XXX: TODO: according to Motorola UM, this is a derivative to 603e */
3479 .pvr_mask
= 0xFFFFFFFF,
3480 .insns_flags
= PPC_INSNS_G2
,
3481 .flags
= PPC_FLAGS_G2
,
3482 .msr_mask
= 0x000000000006FFF2ULL
,
3486 .pvr
= CPU_PPC_G2H4
,
3487 .pvr_mask
= 0xFFFFFFFF,
3488 .insns_flags
= PPC_INSNS_G2
,
3489 .flags
= PPC_FLAGS_G2
,
3490 .msr_mask
= 0x000000000006FFF2ULL
,
3494 .pvr
= CPU_PPC_G2gp
,
3495 .pvr_mask
= 0xFFFFFFFF,
3496 .insns_flags
= PPC_INSNS_G2
,
3497 .flags
= PPC_FLAGS_G2
,
3498 .msr_mask
= 0x000000000006FFF2ULL
,
3502 .pvr
= CPU_PPC_G2ls
,
3503 .pvr_mask
= 0xFFFFFFFF,
3504 .insns_flags
= PPC_INSNS_G2
,
3505 .flags
= PPC_FLAGS_G2
,
3506 .msr_mask
= 0x000000000006FFF2ULL
,
3508 { /* Same as G2, with LE mode support */
3510 .pvr
= CPU_PPC_G2LE
,
3511 .pvr_mask
= 0xFFFFFFFF,
3512 .insns_flags
= PPC_INSNS_G2
,
3513 .flags
= PPC_FLAGS_G2
,
3514 .msr_mask
= 0x000000000007FFF3ULL
,
3518 .pvr
= CPU_PPC_G2LEgp
,
3519 .pvr_mask
= 0xFFFFFFFF,
3520 .insns_flags
= PPC_INSNS_G2
,
3521 .flags
= PPC_FLAGS_G2
,
3522 .msr_mask
= 0x000000000007FFF3ULL
,
3526 .pvr
= CPU_PPC_G2LEls
,
3527 .pvr_mask
= 0xFFFFFFFF,
3528 .insns_flags
= PPC_INSNS_G2
,
3529 .flags
= PPC_FLAGS_G2
,
3530 .msr_mask
= 0x000000000007FFF3ULL
,
3537 .pvr_mask
= 0xFFFFFFFF,
3538 .insns_flags
= PPC_INSNS_604
,
3539 .flags
= PPC_FLAGS_604
,
3540 .msr_mask
= 0x000000000005FF77ULL
,
3545 .pvr
= CPU_PPC_604E
,
3546 .pvr_mask
= 0xFFFFFFFF,
3547 .insns_flags
= PPC_INSNS_604
,
3548 .flags
= PPC_FLAGS_604
,
3549 .msr_mask
= 0x000000000005FF77ULL
,
3554 .pvr
= CPU_PPC_604R
,
3555 .pvr_mask
= 0xFFFFFFFF,
3556 .insns_flags
= PPC_INSNS_604
,
3557 .flags
= PPC_FLAGS_604
,
3558 .msr_mask
= 0x000000000005FF77ULL
,
3564 .pvr_mask
= 0xFFFFFFFF,
3565 .insns_flags
= PPC_INSNS_7x0
,
3566 .flags
= PPC_FLAGS_7x0
,
3567 .msr_mask
= 0x000000000007FF77ULL
,
3573 .pvr_mask
= 0xFFFFFFFF,
3574 .insns_flags
= PPC_INSNS_7x0
,
3575 .flags
= PPC_FLAGS_7x0
,
3576 .msr_mask
= 0x000000000007FF77ULL
,
3581 .pvr_mask
= 0xFFFFFFFF,
3582 .insns_flags
= PPC_INSNS_7x0
,
3583 .flags
= PPC_FLAGS_7x0
,
3584 .msr_mask
= 0x000000000007FF77ULL
,
3589 .pvr
= CPU_PPC_740E
,
3590 .pvr_mask
= 0xFFFFFFFF,
3591 .insns_flags
= PPC_INSNS_7x0
,
3592 .flags
= PPC_FLAGS_7x0
,
3593 .msr_mask
= 0x000000000007FF77ULL
,
3598 .pvr
= CPU_PPC_74xP
,
3599 .pvr_mask
= 0xFFFFFFFF,
3600 .insns_flags
= PPC_INSNS_7x0
,
3601 .flags
= PPC_FLAGS_7x0
,
3602 .msr_mask
= 0x000000000007FF77ULL
,
3605 .name
= "Conan/Doyle",
3606 .pvr
= CPU_PPC_74xP
,
3607 .pvr_mask
= 0xFFFFFFFF,
3608 .insns_flags
= PPC_INSNS_7x0
,
3609 .flags
= PPC_FLAGS_7x0
,
3610 .msr_mask
= 0x000000000007FF77ULL
,
3617 .pvr_mask
= 0xFFFFFFFF,
3618 .insns_flags
= PPC_INSNS_7x5
,
3619 .flags
= PPC_FLAGS_7x5
,
3620 .msr_mask
= 0x000000000007FF77ULL
,
3623 .name
= "Goldfinger",
3625 .pvr_mask
= 0xFFFFFFFF,
3626 .insns_flags
= PPC_INSNS_7x5
,
3627 .flags
= PPC_FLAGS_7x5
,
3628 .msr_mask
= 0x000000000007FF77ULL
,
3635 .pvr
= CPU_PPC_74xP
,
3636 .pvr_mask
= 0xFFFFFFFF,
3637 .insns_flags
= PPC_INSNS_7x5
,
3638 .flags
= PPC_FLAGS_7x5
,
3639 .msr_mask
= 0x000000000007FF77ULL
,
3646 .pvr_mask
= 0xFFFFFFFF,
3647 .insns_flags
= PPC_INSNS_7x0
,
3648 .flags
= PPC_FLAGS_7x0
,
3649 .msr_mask
= 0x000000000007FF77ULL
,
3654 .pvr
= CPU_PPC_74xP
,
3655 .pvr_mask
= 0xFFFFFFFF,
3656 .insns_flags
= PPC_INSNS_7x0
,
3657 .flags
= PPC_FLAGS_7x0
,
3658 .msr_mask
= 0x000000000007FF77ULL
,
3663 .pvr
= CPU_PPC_750E
,
3664 .pvr_mask
= 0xFFFFFFFF,
3665 .insns_flags
= PPC_INSNS_7x0
,
3666 .flags
= PPC_FLAGS_7x0
,
3667 .msr_mask
= 0x000000000007FF77ULL
,
3669 /* IBM 750CXe (G3 embedded) */
3672 .pvr
= CPU_PPC_750CXE
,
3673 .pvr_mask
= 0xFFFFFFFF,
3674 .insns_flags
= PPC_INSNS_7x0
,
3675 .flags
= PPC_FLAGS_7x0
,
3676 .msr_mask
= 0x000000000007FF77ULL
,
3678 /* IBM 750CXr (G3 embedded) */
3681 .pvr
= CPU_PPC_750CXR
,
3682 .pvr_mask
= 0xFFFFFFFF,
3683 .insns_flags
= PPC_INSNS_7x0
,
3684 .flags
= PPC_FLAGS_7x0
,
3685 .msr_mask
= 0x000000000007FF77ULL
,
3687 /* IBM 750FX (G3 embedded) */
3690 .pvr
= CPU_PPC_750FX
,
3691 .pvr_mask
= 0xFFFFFFFF,
3692 .insns_flags
= PPC_INSNS_7x0
,
3693 .flags
= PPC_FLAGS_7x0
,
3694 .msr_mask
= 0x000000000007FF77ULL
,
3696 /* IBM 750FL (G3 embedded) */
3699 .pvr
= CPU_PPC_750FL
,
3700 .pvr_mask
= 0xFFFFFFFF,
3701 .insns_flags
= PPC_INSNS_7x0
,
3702 .flags
= PPC_FLAGS_7x0
,
3703 .msr_mask
= 0x000000000007FF77ULL
,
3705 /* IBM 750GX (G3 embedded) */
3708 .pvr
= CPU_PPC_750GX
,
3709 .pvr_mask
= 0xFFFFFFFF,
3710 .insns_flags
= PPC_INSNS_7x0
,
3711 .flags
= PPC_FLAGS_7x0
,
3712 .msr_mask
= 0x000000000007FF77ULL
,
3714 /* IBM 750L (G3 embedded) */
3717 .pvr
= CPU_PPC_750L
,
3718 .pvr_mask
= 0xFFFFFFFF,
3719 .insns_flags
= PPC_INSNS_7x0
,
3720 .flags
= PPC_FLAGS_7x0
,
3721 .msr_mask
= 0x000000000007FF77ULL
,
3723 /* IBM 750CL (G3 embedded) */
3726 .pvr
= CPU_PPC_750CL
,
3727 .pvr_mask
= 0xFFFFFFFF,
3728 .insns_flags
= PPC_INSNS_7x0
,
3729 .flags
= PPC_FLAGS_7x0
,
3730 .msr_mask
= 0x000000000007FF77ULL
,
3737 .pvr_mask
= 0xFFFFFFFF,
3738 .insns_flags
= PPC_INSNS_7x5
,
3739 .flags
= PPC_FLAGS_7x5
,
3740 .msr_mask
= 0x000000000007FF77ULL
,
3747 .pvr
= CPU_PPC_755D
,
3748 .pvr_mask
= 0xFFFFFFFF,
3749 .insns_flags
= PPC_INSNS_7x5
,
3750 .flags
= PPC_FLAGS_7x5
,
3751 .msr_mask
= 0x000000000007FF77ULL
,
3758 .pvr
= CPU_PPC_755E
,
3759 .pvr_mask
= 0xFFFFFFFF,
3760 .insns_flags
= PPC_INSNS_7x5
,
3761 .flags
= PPC_FLAGS_7x5
,
3762 .msr_mask
= 0x000000000007FF77ULL
,
3769 .pvr
= CPU_PPC_74xP
,
3770 .pvr_mask
= 0xFFFFFFFF,
3771 .insns_flags
= PPC_INSNS_7x5
,
3772 .flags
= PPC_FLAGS_7x5
,
3773 .msr_mask
= 0x000000000007FF77ULL
,
3780 .pvr
= CPU_PPC_7400
,
3781 .pvr_mask
= 0xFFFFFFFF,
3782 .insns_flags
= PPC_INSNS_74xx
,
3783 .flags
= PPC_FLAGS_74xx
,
3784 .msr_mask
= 0x000000000205FF77ULL
,
3788 /* PowerPC 7400 (G4) */
3791 .pvr
= CPU_PPC_7400
,
3792 .pvr_mask
= 0xFFFFFFFF,
3793 .insns_flags
= PPC_INSNS_74xx
,
3794 .flags
= PPC_FLAGS_74xx
,
3795 .msr_mask
= 0x000000000205FF77ULL
,
3799 .pvr
= CPU_PPC_7400
,
3800 .pvr_mask
= 0xFFFFFFFF,
3801 .insns_flags
= PPC_INSNS_74xx
,
3802 .flags
= PPC_FLAGS_74xx
,
3803 .msr_mask
= 0x000000000205FF77ULL
,
3807 /* PowerPC 7410 (G4) */
3810 .pvr
= CPU_PPC_7410
,
3811 .pvr_mask
= 0xFFFFFFFF,
3812 .insns_flags
= PPC_INSNS_74xx
,
3813 .flags
= PPC_FLAGS_74xx
,
3814 .msr_mask
= 0x000000000205FF77ULL
,
3818 .pvr
= CPU_PPC_7410
,
3819 .pvr_mask
= 0xFFFFFFFF,
3820 .insns_flags
= PPC_INSNS_74xx
,
3821 .flags
= PPC_FLAGS_74xx
,
3822 .msr_mask
= 0x000000000205FF77ULL
,
3826 /* PowerPC 7441 (G4) */
3829 .pvr
= CPU_PPC_7441
,
3830 .pvr_mask
= 0xFFFFFFFF,
3831 .insns_flags
= PPC_INSNS_74xx
,
3832 .flags
= PPC_FLAGS_74xx
,
3833 .msr_mask
= 0x000000000205FF77ULL
,
3837 /* PowerPC 7445 (G4) */
3840 .pvr
= CPU_PPC_7445
,
3841 .pvr_mask
= 0xFFFFFFFF,
3842 .insns_flags
= PPC_INSNS_74xx
,
3843 .flags
= PPC_FLAGS_74xx
,
3844 .msr_mask
= 0x000000000205FF77ULL
,
3848 /* PowerPC 7447 (G4) */
3851 .pvr
= CPU_PPC_7447
,
3852 .pvr_mask
= 0xFFFFFFFF,
3853 .insns_flags
= PPC_INSNS_74xx
,
3854 .flags
= PPC_FLAGS_74xx
,
3855 .msr_mask
= 0x000000000205FF77ULL
,
3859 /* PowerPC 7447A (G4) */
3862 .pvr
= CPU_PPC_7447A
,
3863 .pvr_mask
= 0xFFFFFFFF,
3864 .insns_flags
= PPC_INSNS_74xx
,
3865 .flags
= PPC_FLAGS_74xx
,
3866 .msr_mask
= 0x000000000205FF77ULL
,
3870 /* PowerPC 7448 (G4) */
3873 .pvr
= CPU_PPC_7448
,
3874 .pvr_mask
= 0xFFFFFFFF,
3875 .insns_flags
= PPC_INSNS_74xx
,
3876 .flags
= PPC_FLAGS_74xx
,
3877 .msr_mask
= 0x000000000205FF77ULL
,
3881 /* PowerPC 7450 (G4) */
3884 .pvr
= CPU_PPC_7450
,
3885 .pvr_mask
= 0xFFFFFFFF,
3886 .insns_flags
= PPC_INSNS_74xx
,
3887 .flags
= PPC_FLAGS_74xx
,
3888 .msr_mask
= 0x000000000205FF77ULL
,
3892 .pvr
= CPU_PPC_7450
,
3893 .pvr_mask
= 0xFFFFFFFF,
3894 .insns_flags
= PPC_INSNS_74xx
,
3895 .flags
= PPC_FLAGS_74xx
,
3896 .msr_mask
= 0x000000000205FF77ULL
,
3900 /* PowerPC 7450b (G4) */
3903 .pvr
= CPU_PPC_7450B
,
3904 .pvr_mask
= 0xFFFFFFFF,
3905 .insns_flags
= PPC_INSNS_74xx
,
3906 .flags
= PPC_FLAGS_74xx
,
3907 .msr_mask
= 0x000000000205FF77ULL
,
3911 /* PowerPC 7451 (G4) */
3914 .pvr
= CPU_PPC_7451
,
3915 .pvr_mask
= 0xFFFFFFFF,
3916 .insns_flags
= PPC_INSNS_74xx
,
3917 .flags
= PPC_FLAGS_74xx
,
3918 .msr_mask
= 0x000000000205FF77ULL
,
3922 /* PowerPC 7451g (G4) */
3925 .pvr
= CPU_PPC_7451G
,
3926 .pvr_mask
= 0xFFFFFFFF,
3927 .insns_flags
= PPC_INSNS_74xx
,
3928 .flags
= PPC_FLAGS_74xx
,
3929 .msr_mask
= 0x000000000205FF77ULL
,
3933 /* PowerPC 7455 (G4) */
3936 .pvr
= CPU_PPC_7455
,
3937 .pvr_mask
= 0xFFFFFFFF,
3938 .insns_flags
= PPC_INSNS_74xx
,
3939 .flags
= PPC_FLAGS_74xx
,
3940 .msr_mask
= 0x000000000205FF77ULL
,
3944 .pvr
= CPU_PPC_7455
,
3945 .pvr_mask
= 0xFFFFFFFF,
3946 .insns_flags
= PPC_INSNS_74xx
,
3947 .flags
= PPC_FLAGS_74xx
,
3948 .msr_mask
= 0x000000000205FF77ULL
,
3952 /* PowerPC 7455F (G4) */
3955 .pvr
= CPU_PPC_7455F
,
3956 .pvr_mask
= 0xFFFFFFFF,
3957 .insns_flags
= PPC_INSNS_74xx
,
3958 .flags
= PPC_FLAGS_74xx
,
3959 .msr_mask
= 0x000000000205FF77ULL
,
3963 /* PowerPC 7455G (G4) */
3966 .pvr
= CPU_PPC_7455G
,
3967 .pvr_mask
= 0xFFFFFFFF,
3968 .insns_flags
= PPC_INSNS_74xx
,
3969 .flags
= PPC_FLAGS_74xx
,
3970 .msr_mask
= 0x000000000205FF77ULL
,
3974 /* PowerPC 7457 (G4) */
3977 .pvr
= CPU_PPC_7457
,
3978 .pvr_mask
= 0xFFFFFFFF,
3979 .insns_flags
= PPC_INSNS_74xx
,
3980 .flags
= PPC_FLAGS_74xx
,
3981 .msr_mask
= 0x000000000205FF77ULL
,
3985 .pvr
= CPU_PPC_7457
,
3986 .pvr_mask
= 0xFFFFFFFF,
3987 .insns_flags
= PPC_INSNS_74xx
,
3988 .flags
= PPC_FLAGS_74xx
,
3989 .msr_mask
= 0x000000000205FF77ULL
,
3993 /* PowerPC 7457A (G4) */
3996 .pvr
= CPU_PPC_7457A
,
3997 .pvr_mask
= 0xFFFFFFFF,
3998 .insns_flags
= PPC_INSNS_74xx
,
3999 .flags
= PPC_FLAGS_74xx
,
4000 .msr_mask
= 0x000000000205FF77ULL
,
4003 .name
= "Apollo 7 PM",
4004 .pvr
= CPU_PPC_7457A
,
4005 .pvr_mask
= 0xFFFFFFFF,
4006 .insns_flags
= PPC_INSNS_74xx
,
4007 .flags
= PPC_FLAGS_74xx
,
4008 .msr_mask
= 0x000000000205FF77ULL
,
4012 /* PowerPC 7457C (G4) */
4015 .pvr
= CPU_PPC_7457C
,
4016 .pvr_mask
= 0xFFFFFFFF,
4017 .insns_flags
= PPC_INSNS_74xx
,
4018 .flags
= PPC_FLAGS_74xx
,
4019 .msr_mask
= 0x000000000205FF77ULL
,
4022 /* 64 bits PowerPC */
4023 #if defined (TARGET_PPC64)
4029 .pvr_mask
= 0xFFFFFFFF,
4030 .insns_flags
= PPC_INSNS_620
,
4031 .flags
= PPC_FLAGS_620
,
4032 .msr_mask
= 0x800000000005FF73ULL
,
4036 /* PowerPC 630 (POWER3) */
4040 .pvr_mask
= 0xFFFFFFFF,
4041 .insns_flags
= PPC_INSNS_630
,
4042 .flags
= PPC_FLAGS_630
,
4048 .pvr_mask
= 0xFFFFFFFF,
4049 .insns_flags
= PPC_INSNS_630
,
4050 .flags
= PPC_FLAGS_630
,
4055 /* PowerPC 631 (Power 3+)*/
4059 .pvr_mask
= 0xFFFFFFFF,
4060 .insns_flags
= PPC_INSNS_631
,
4061 .flags
= PPC_FLAGS_631
,
4067 .pvr_mask
= 0xFFFFFFFF,
4068 .insns_flags
= PPC_INSNS_631
,
4069 .flags
= PPC_FLAGS_631
,
4077 .pvr
= CPU_PPC_POWER4
,
4078 .pvr_mask
= 0xFFFFFFFF,
4079 .insns_flags
= PPC_INSNS_POWER4
,
4080 .flags
= PPC_FLAGS_POWER4
,
4088 .pvr
= CPU_PPC_POWER4P
,
4089 .pvr_mask
= 0xFFFFFFFF,
4090 .insns_flags
= PPC_INSNS_POWER4
,
4091 .flags
= PPC_FLAGS_POWER4
,
4099 .pvr
= CPU_PPC_POWER5
,
4100 .pvr_mask
= 0xFFFFFFFF,
4101 .insns_flags
= PPC_INSNS_POWER5
,
4102 .flags
= PPC_FLAGS_POWER5
,
4110 .pvr
= CPU_PPC_POWER5P
,
4111 .pvr_mask
= 0xFFFFFFFF,
4112 .insns_flags
= PPC_INSNS_POWER5
,
4113 .flags
= PPC_FLAGS_POWER5
,
4121 .pvr
= CPU_PPC_POWER6
,
4122 .pvr_mask
= 0xFFFFFFFF,
4123 .insns_flags
= PPC_INSNS_POWER6
,
4124 .flags
= PPC_FLAGS_POWER6
,
4133 .pvr_mask
= 0xFFFFFFFF,
4134 .insns_flags
= PPC_INSNS_970
,
4135 .flags
= PPC_FLAGS_970
,
4136 .msr_mask
= 0x900000000204FF36ULL
,
4140 /* PowerPC 970FX (G5) */
4143 .pvr
= CPU_PPC_970FX
,
4144 .pvr_mask
= 0xFFFFFFFF,
4145 .insns_flags
= PPC_INSNS_970FX
,
4146 .flags
= PPC_FLAGS_970FX
,
4147 .msr_mask
= 0x800000000204FF36ULL
,
4154 .pvr
= CPU_PPC_970MP
,
4155 .pvr_mask
= 0xFFFFFFFF,
4156 .insns_flags
= PPC_INSNS_970
,
4157 .flags
= PPC_FLAGS_970
,
4158 .msr_mask
= 0x900000000204FF36ULL
,
4165 .pvr
= CPU_PPC_CELL
,
4166 .pvr_mask
= 0xFFFFFFFF,
4167 .insns_flags
= PPC_INSNS_970
,
4168 .flags
= PPC_FLAGS_970
,
4169 .msr_mask
= 0x900000000204FF36ULL
,
4173 /* RS64 (Apache/A35) */
4174 /* This one seems to support the whole POWER2 instruction set
4175 * and the PowerPC 64 one.
4179 .pvr
= CPU_PPC_RS64
,
4180 .pvr_mask
= 0xFFFFFFFF,
4181 .insns_flags
= PPC_INSNS_RS64
,
4182 .flags
= PPC_FLAGS_RS64
,
4187 .pvr
= CPU_PPC_RS64
,
4188 .pvr_mask
= 0xFFFFFFFF,
4189 .insns_flags
= PPC_INSNS_RS64
,
4190 .flags
= PPC_FLAGS_RS64
,
4195 .pvr
= CPU_PPC_RS64
,
4196 .pvr_mask
= 0xFFFFFFFF,
4197 .insns_flags
= PPC_INSNS_RS64
,
4198 .flags
= PPC_FLAGS_RS64
,
4203 /* RS64-II (NorthStar/A50) */
4206 .pvr
= CPU_PPC_RS64II
,
4207 .pvr_mask
= 0xFFFFFFFF,
4208 .insns_flags
= PPC_INSNS_RS64
,
4209 .flags
= PPC_FLAGS_RS64
,
4214 .pvr
= CPU_PPC_RS64II
,
4215 .pvr_mask
= 0xFFFFFFFF,
4216 .insns_flags
= PPC_INSNS_RS64
,
4217 .flags
= PPC_FLAGS_RS64
,
4222 .pvr
= CPU_PPC_RS64II
,
4223 .pvr_mask
= 0xFFFFFFFF,
4224 .insns_flags
= PPC_INSNS_RS64
,
4225 .flags
= PPC_FLAGS_RS64
,
4230 /* RS64-III (Pulsar) */
4233 .pvr
= CPU_PPC_RS64III
,
4234 .pvr_mask
= 0xFFFFFFFF,
4235 .insns_flags
= PPC_INSNS_RS64
,
4236 .flags
= PPC_FLAGS_RS64
,
4241 .pvr
= CPU_PPC_RS64III
,
4242 .pvr_mask
= 0xFFFFFFFF,
4243 .insns_flags
= PPC_INSNS_RS64
,
4244 .flags
= PPC_FLAGS_RS64
,
4249 /* RS64-IV (IceStar/IStar/SStar) */
4252 .pvr
= CPU_PPC_RS64IV
,
4253 .pvr_mask
= 0xFFFFFFFF,
4254 .insns_flags
= PPC_INSNS_RS64
,
4255 .flags
= PPC_FLAGS_RS64
,
4260 .pvr
= CPU_PPC_RS64IV
,
4261 .pvr_mask
= 0xFFFFFFFF,
4262 .insns_flags
= PPC_INSNS_RS64
,
4263 .flags
= PPC_FLAGS_RS64
,
4268 .pvr
= CPU_PPC_RS64IV
,
4269 .pvr_mask
= 0xFFFFFFFF,
4270 .insns_flags
= PPC_INSNS_RS64
,
4271 .flags
= PPC_FLAGS_RS64
,
4276 .pvr
= CPU_PPC_RS64IV
,
4277 .pvr_mask
= 0xFFFFFFFF,
4278 .insns_flags
= PPC_INSNS_RS64
,
4279 .flags
= PPC_FLAGS_RS64
,
4285 /* Original POWER */
4289 .pvr_mask
= 0xFFFFFFFF,
4290 .insns_flags
= PPC_INSNS_POWER
,
4291 .flags
= PPC_FLAGS_POWER
,
4295 #endif /* defined (TARGET_PPC64) */
4301 .pvr_mask
= 0xFFFFFFFF,
4302 .insns_flags
= PPC_INSNS_POWER
,
4303 .flags
= PPC_FLAGS_POWER
,
4307 /* Generic PowerPCs */
4311 .pvr
= CPU_PPC_970FX
,
4312 .pvr_mask
= 0xFFFFFFFF,
4313 .insns_flags
= PPC_INSNS_PPC64
,
4314 .flags
= PPC_FLAGS_PPC64
,
4315 .msr_mask
= 0xA00000000204FF36ULL
,
4321 .pvr_mask
= 0xFFFFFFFF,
4322 .insns_flags
= PPC_INSNS_PPC32
,
4323 .flags
= PPC_FLAGS_PPC32
,
4324 .msr_mask
= 0x000000000005FF77ULL
,
4330 .pvr_mask
= 0xFFFFFFFF,
4331 .insns_flags
= PPC_INSNS_PPC32
,
4332 .flags
= PPC_FLAGS_PPC32
,
4333 .msr_mask
= 0x000000000005FF77ULL
,
4337 int ppc_find_by_name (const unsigned char *name
, ppc_def_t
**def
)
4343 for (i
= 0; strcmp(ppc_defs
[i
].name
, "ppc") != 0; i
++) {
4344 if (strcasecmp(name
, ppc_defs
[i
].name
) == 0) {
4345 *def
= &ppc_defs
[i
];
4354 int ppc_find_by_pvr (uint32_t pvr
, ppc_def_t
**def
)
4360 for (i
= 0; ppc_defs
[i
].name
!= NULL
; i
++) {
4361 if ((pvr
& ppc_defs
[i
].pvr_mask
) ==
4362 (ppc_defs
[i
].pvr
& ppc_defs
[i
].pvr_mask
)) {
4363 *def
= &ppc_defs
[i
];
4372 void ppc_cpu_list (FILE *f
, int (*cpu_fprintf
)(FILE *f
, const char *fmt
, ...))
4376 for (i
= 0; ; i
++) {
4377 (*cpu_fprintf
)(f
, "PowerPC %16s PVR %08x mask %08x\n",
4379 ppc_defs
[i
].pvr
, ppc_defs
[i
].pvr_mask
);
4380 if (strcmp(ppc_defs
[i
].name
, "ppc") == 0)