Commit 237c0af0175d78955a3007372a2c9789a05705be

Authored by j_mayer
1 parent d12f4c38

Define the proper bfd_mach to be used by the disassembler for each

PowerPC emulated CPU.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3257 c046a42c-6fe2-441c-8c8c-71466251a162
@@ -178,13 +178,18 @@ void target_disas(FILE *out, target_ulong code, target_ulong size, int flags) @@ -178,13 +178,18 @@ void target_disas(FILE *out, target_ulong code, target_ulong size, int flags)
178 disasm_info.mach = bfd_mach_sparc_v9b; 178 disasm_info.mach = bfd_mach_sparc_v9b;
179 #endif 179 #endif
180 #elif defined(TARGET_PPC) 180 #elif defined(TARGET_PPC)
181 - if (flags) 181 + if (flags >> 16)
182 disasm_info.endian = BFD_ENDIAN_LITTLE; 182 disasm_info.endian = BFD_ENDIAN_LITTLE;
  183 + if (flags & 0xFFFF) {
  184 + /* If we have a precise definitions of the instructions set, use it */
  185 + disasm_info.mach = flags & 0xFFFF;
  186 + } else {
183 #ifdef TARGET_PPC64 187 #ifdef TARGET_PPC64
184 - disasm_info.mach = bfd_mach_ppc64; 188 + disasm_info.mach = bfd_mach_ppc64;
185 #else 189 #else
186 - disasm_info.mach = bfd_mach_ppc; 190 + disasm_info.mach = bfd_mach_ppc;
187 #endif 191 #endif
  192 + }
188 print_insn = print_insn_ppc; 193 print_insn = print_insn_ppc;
189 #elif defined(TARGET_M68K) 194 #elif defined(TARGET_M68K)
190 print_insn = print_insn_m68k; 195 print_insn = print_insn_m68k;
target-ppc/cpu.h
@@ -398,6 +398,7 @@ struct CPUPPCState { @@ -398,6 +398,7 @@ struct CPUPPCState {
398 uint8_t excp_model; 398 uint8_t excp_model;
399 uint8_t bus_model; 399 uint8_t bus_model;
400 uint8_t pad; 400 uint8_t pad;
  401 + int bfd_mach;
401 uint32_t flags; 402 uint32_t flags;
402 403
403 int exception_index; 404 int exception_index;
target-ppc/translate.c
@@ -6108,7 +6108,8 @@ static inline int gen_intermediate_code_internal (CPUState *env, @@ -6108,7 +6108,8 @@ static inline int gen_intermediate_code_internal (CPUState *env,
6108 } 6108 }
6109 if (loglevel & CPU_LOG_TB_IN_ASM) { 6109 if (loglevel & CPU_LOG_TB_IN_ASM) {
6110 int flags; 6110 int flags;
6111 - flags = msr_le; 6111 + flags = env->bfd_mach;
  6112 + flags |= msr_le << 16;
6112 fprintf(logfile, "IN: %s\n", lookup_symbol(pc_start)); 6113 fprintf(logfile, "IN: %s\n", lookup_symbol(pc_start));
6113 target_disas(logfile, pc_start, ctx.nip - pc_start, flags); 6114 target_disas(logfile, pc_start, ctx.nip - pc_start, flags);
6114 fprintf(logfile, "\n"); 6115 fprintf(logfile, "\n");
target-ppc/translate_init.c
@@ -23,6 +23,8 @@ @@ -23,6 +23,8 @@
23 * inside "#if defined(TODO) ... #endif" statements to make tests easier. 23 * inside "#if defined(TODO) ... #endif" statements to make tests easier.
24 */ 24 */
25 25
  26 +#include "dis-asm.h"
  27 +
26 //#define PPC_DUMP_CPU 28 //#define PPC_DUMP_CPU
27 //#define PPC_DEBUG_SPR 29 //#define PPC_DEBUG_SPR
28 //#define PPC_DEBUG_IRQ 30 //#define PPC_DEBUG_IRQ
@@ -37,6 +39,7 @@ struct ppc_def_t { @@ -37,6 +39,7 @@ struct ppc_def_t {
37 uint8_t excp_model; 39 uint8_t excp_model;
38 uint8_t bus_model; 40 uint8_t bus_model;
39 uint8_t pad; 41 uint8_t pad;
  42 + int bfd_mach;
40 void (*init_proc)(CPUPPCState *env); 43 void (*init_proc)(CPUPPCState *env);
41 }; 44 };
42 45
@@ -2163,6 +2166,7 @@ static void gen_spr_620 (CPUPPCState *env) @@ -2163,6 +2166,7 @@ static void gen_spr_620 (CPUPPCState *env)
2163 #define POWERPC_MMU_401 (POWERPC_MMU_REAL_4xx) 2166 #define POWERPC_MMU_401 (POWERPC_MMU_REAL_4xx)
2164 #define POWERPC_EXCP_401 (POWERPC_EXCP_40x) 2167 #define POWERPC_EXCP_401 (POWERPC_EXCP_40x)
2165 #define POWERPC_INPUT_401 (PPC_FLAGS_INPUT_401) 2168 #define POWERPC_INPUT_401 (PPC_FLAGS_INPUT_401)
  2169 +#define POWERPC_BFDM_401 (bfd_mach_ppc_403)
2166 2170
2167 static void init_proc_401 (CPUPPCState *env) 2171 static void init_proc_401 (CPUPPCState *env)
2168 { 2172 {
@@ -2192,6 +2196,7 @@ static void init_proc_401 (CPUPPCState *env) @@ -2192,6 +2196,7 @@ static void init_proc_401 (CPUPPCState *env)
2192 #define POWERPC_MMU_401x2 (POWERPC_MMU_SOFT_4xx_Z) 2196 #define POWERPC_MMU_401x2 (POWERPC_MMU_SOFT_4xx_Z)
2193 #define POWERPC_EXCP_401x2 (POWERPC_EXCP_40x) 2197 #define POWERPC_EXCP_401x2 (POWERPC_EXCP_40x)
2194 #define POWERPC_INPUT_401x2 (PPC_FLAGS_INPUT_401) 2198 #define POWERPC_INPUT_401x2 (PPC_FLAGS_INPUT_401)
  2199 +#define POWERPC_BFDM_401x2 (bfd_mach_ppc_403)
2195 2200
2196 static void init_proc_401x2 (CPUPPCState *env) 2201 static void init_proc_401x2 (CPUPPCState *env)
2197 { 2202 {
@@ -2227,6 +2232,7 @@ static void init_proc_401x2 (CPUPPCState *env) @@ -2227,6 +2232,7 @@ static void init_proc_401x2 (CPUPPCState *env)
2227 #define POWERPC_MMU_401x3 (POWERPC_MMU_SOFT_4xx_Z) 2232 #define POWERPC_MMU_401x3 (POWERPC_MMU_SOFT_4xx_Z)
2228 #define POWERPC_EXCP_401x3 (POWERPC_EXCP_40x) 2233 #define POWERPC_EXCP_401x3 (POWERPC_EXCP_40x)
2229 #define POWERPC_INPUT_401x3 (PPC_FLAGS_INPUT_401) 2234 #define POWERPC_INPUT_401x3 (PPC_FLAGS_INPUT_401)
  2235 +#define POWERPC_BFDM_401x3 (bfd_mach_ppc_403)
2230 2236
2231 static void init_proc_401x2 (CPUPPCState *env) 2237 static void init_proc_401x2 (CPUPPCState *env)
2232 { 2238 {
@@ -2243,6 +2249,7 @@ static void init_proc_401x2 (CPUPPCState *env) @@ -2243,6 +2249,7 @@ static void init_proc_401x2 (CPUPPCState *env)
2243 #define POWERPC_MMU_IOP480 (POWERPC_MMU_SOFT_4xx_Z) 2249 #define POWERPC_MMU_IOP480 (POWERPC_MMU_SOFT_4xx_Z)
2244 #define POWERPC_EXCP_IOP480 (POWERPC_EXCP_40x) 2250 #define POWERPC_EXCP_IOP480 (POWERPC_EXCP_40x)
2245 #define POWERPC_INPUT_IOP480 (PPC_FLAGS_INPUT_401) 2251 #define POWERPC_INPUT_IOP480 (PPC_FLAGS_INPUT_401)
  2252 +#define POWERPC_BFDM_IOP480 (bfd_mach_ppc_403)
2246 2253
2247 static void init_proc_IOP480 (CPUPPCState *env) 2254 static void init_proc_IOP480 (CPUPPCState *env)
2248 { 2255 {
@@ -2276,6 +2283,7 @@ static void init_proc_IOP480 (CPUPPCState *env) @@ -2276,6 +2283,7 @@ static void init_proc_IOP480 (CPUPPCState *env)
2276 #define POWERPC_MMU_403 (POWERPC_MMU_REAL_4xx) 2283 #define POWERPC_MMU_403 (POWERPC_MMU_REAL_4xx)
2277 #define POWERPC_EXCP_403 (POWERPC_EXCP_40x) 2284 #define POWERPC_EXCP_403 (POWERPC_EXCP_40x)
2278 #define POWERPC_INPUT_403 (PPC_FLAGS_INPUT_401) 2285 #define POWERPC_INPUT_403 (PPC_FLAGS_INPUT_401)
  2286 +#define POWERPC_BFDM_403 (bfd_mach_ppc_403)
2279 2287
2280 static void init_proc_403 (CPUPPCState *env) 2288 static void init_proc_403 (CPUPPCState *env)
2281 { 2289 {
@@ -2295,6 +2303,7 @@ static void init_proc_403 (CPUPPCState *env) @@ -2295,6 +2303,7 @@ static void init_proc_403 (CPUPPCState *env)
2295 #define POWERPC_MMU_403GCX (POWERPC_MMU_SOFT_4xx_Z) 2303 #define POWERPC_MMU_403GCX (POWERPC_MMU_SOFT_4xx_Z)
2296 #define POWERPC_EXCP_403GCX (POWERPC_EXCP_40x) 2304 #define POWERPC_EXCP_403GCX (POWERPC_EXCP_40x)
2297 #define POWERPC_INPUT_403GCX (PPC_FLAGS_INPUT_401) 2305 #define POWERPC_INPUT_403GCX (PPC_FLAGS_INPUT_401)
  2306 +#define POWERPC_BFDM_403GCX (bfd_mach_ppc_403)
2298 2307
2299 static void init_proc_403GCX (CPUPPCState *env) 2308 static void init_proc_403GCX (CPUPPCState *env)
2300 { 2309 {
@@ -2330,6 +2339,7 @@ static void init_proc_403GCX (CPUPPCState *env) @@ -2330,6 +2339,7 @@ static void init_proc_403GCX (CPUPPCState *env)
2330 #define POWERPC_MMU_405 (POWERPC_MMU_SOFT_4xx) 2339 #define POWERPC_MMU_405 (POWERPC_MMU_SOFT_4xx)
2331 #define POWERPC_EXCP_405 (POWERPC_EXCP_40x) 2340 #define POWERPC_EXCP_405 (POWERPC_EXCP_40x)
2332 #define POWERPC_INPUT_405 (PPC_FLAGS_INPUT_405) 2341 #define POWERPC_INPUT_405 (PPC_FLAGS_INPUT_405)
  2342 +#define POWERPC_BFDM_405 (bfd_mach_ppc_403)
2333 2343
2334 static void init_proc_405 (CPUPPCState *env) 2344 static void init_proc_405 (CPUPPCState *env)
2335 { 2345 {
@@ -2364,6 +2374,7 @@ static void init_proc_405 (CPUPPCState *env) @@ -2364,6 +2374,7 @@ static void init_proc_405 (CPUPPCState *env)
2364 #define POWERPC_MMU_440EP (POWERPC_MMU_BOOKE) 2374 #define POWERPC_MMU_440EP (POWERPC_MMU_BOOKE)
2365 #define POWERPC_EXCP_440EP (POWERPC_EXCP_BOOKE) 2375 #define POWERPC_EXCP_440EP (POWERPC_EXCP_BOOKE)
2366 #define POWERPC_INPUT_440EP (PPC_FLAGS_INPUT_BookE) 2376 #define POWERPC_INPUT_440EP (PPC_FLAGS_INPUT_BookE)
  2377 +#define POWERPC_BFDM_440EP (bfd_mach_ppc_403)
2367 2378
2368 static void init_proc_440EP (CPUPPCState *env) 2379 static void init_proc_440EP (CPUPPCState *env)
2369 { 2380 {
@@ -2403,6 +2414,7 @@ static void init_proc_440EP (CPUPPCState *env) @@ -2403,6 +2414,7 @@ static void init_proc_440EP (CPUPPCState *env)
2403 #define POWERPC_MMU_440GP (POWERPC_MMU_BOOKE) 2414 #define POWERPC_MMU_440GP (POWERPC_MMU_BOOKE)
2404 #define POWERPC_EXCP_440GP (POWERPC_EXCP_BOOKE) 2415 #define POWERPC_EXCP_440GP (POWERPC_EXCP_BOOKE)
2405 #define POWERPC_INPUT_440GP (PPC_FLAGS_INPUT_BookE) 2416 #define POWERPC_INPUT_440GP (PPC_FLAGS_INPUT_BookE)
  2417 +#define POWERPC_BFDM_440GP (bfd_mach_ppc_403)
2406 2418
2407 static void init_proc_440GP (CPUPPCState *env) 2419 static void init_proc_440GP (CPUPPCState *env)
2408 { 2420 {
@@ -2427,6 +2439,7 @@ static void init_proc_440GP (CPUPPCState *env) @@ -2427,6 +2439,7 @@ static void init_proc_440GP (CPUPPCState *env)
2427 #define POWERPC_MMU_440x4 (POWERPC_MMU_BOOKE) 2439 #define POWERPC_MMU_440x4 (POWERPC_MMU_BOOKE)
2428 #define POWERPC_EXCP_440x4 (POWERPC_EXCP_BOOKE) 2440 #define POWERPC_EXCP_440x4 (POWERPC_EXCP_BOOKE)
2429 #define POWERPC_INPUT_440x4 (PPC_FLAGS_INPUT_BookE) 2441 #define POWERPC_INPUT_440x4 (PPC_FLAGS_INPUT_BookE)
  2442 +#define POWERPC_BFDM_440x4 (bfd_mach_ppc_403)
2430 2443
2431 static void init_proc_440x4 (CPUPPCState *env) 2444 static void init_proc_440x4 (CPUPPCState *env)
2432 { 2445 {
@@ -2451,6 +2464,7 @@ static void init_proc_440x4 (CPUPPCState *env) @@ -2451,6 +2464,7 @@ static void init_proc_440x4 (CPUPPCState *env)
2451 #define POWERPC_MMU_440x5 (POWERPC_MMU_BOOKE) 2464 #define POWERPC_MMU_440x5 (POWERPC_MMU_BOOKE)
2452 #define POWERPC_EXCP_440x5 (POWERPC_EXCP_BOOKE) 2465 #define POWERPC_EXCP_440x5 (POWERPC_EXCP_BOOKE)
2453 #define POWERPC_INPUT_440x5 (PPC_FLAGS_INPUT_BookE) 2466 #define POWERPC_INPUT_440x5 (PPC_FLAGS_INPUT_BookE)
  2467 +#define POWERPC_BFDM_440x5 (bfd_mach_ppc_403)
2454 2468
2455 static void init_proc_440x5 (CPUPPCState *env) 2469 static void init_proc_440x5 (CPUPPCState *env)
2456 { 2470 {
@@ -2491,6 +2505,7 @@ static void init_proc_440x5 (CPUPPCState *env) @@ -2491,6 +2505,7 @@ static void init_proc_440x5 (CPUPPCState *env)
2491 #define POWERPC_MMU_460 (POWERPC_MMU_BOOKE) 2505 #define POWERPC_MMU_460 (POWERPC_MMU_BOOKE)
2492 #define POWERPC_EXCP_460 (POWERPC_EXCP_BOOKE) 2506 #define POWERPC_EXCP_460 (POWERPC_EXCP_BOOKE)
2493 #define POWERPC_INPUT_460 (PPC_FLAGS_INPUT_BookE) 2507 #define POWERPC_INPUT_460 (PPC_FLAGS_INPUT_BookE)
  2508 +#define POWERPC_BFDM_460 (bfd_mach_ppc_403)
2494 2509
2495 static void init_proc_460 (CPUPPCState *env) 2510 static void init_proc_460 (CPUPPCState *env)
2496 { 2511 {
@@ -2510,6 +2525,7 @@ static void init_proc_460 (CPUPPCState *env) @@ -2510,6 +2525,7 @@ static void init_proc_460 (CPUPPCState *env)
2510 #define POWERPC_MMU_460F (POWERPC_MMU_BOOKE) 2525 #define POWERPC_MMU_460F (POWERPC_MMU_BOOKE)
2511 #define POWERPC_EXCP_460F (POWERPC_EXCP_BOOKE) 2526 #define POWERPC_EXCP_460F (POWERPC_EXCP_BOOKE)
2512 #define POWERPC_INPUT_460F (PPC_FLAGS_INPUT_BookE) 2527 #define POWERPC_INPUT_460F (PPC_FLAGS_INPUT_BookE)
  2528 +#define POWERPC_BFDM_460F (bfd_mach_ppc_403)
2513 2529
2514 static void init_proc_460 (CPUPPCState *env) 2530 static void init_proc_460 (CPUPPCState *env)
2515 { 2531 {
@@ -2558,6 +2574,7 @@ static void init_proc_460 (CPUPPCState *env) @@ -2558,6 +2574,7 @@ static void init_proc_460 (CPUPPCState *env)
2558 #define POWERPC_MMU_BookE (POWERPC_MMU_BOOKE) 2574 #define POWERPC_MMU_BookE (POWERPC_MMU_BOOKE)
2559 #define POWERPC_EXCP_BookE (POWERPC_EXCP_BOOKE) 2575 #define POWERPC_EXCP_BookE (POWERPC_EXCP_BOOKE)
2560 #define POWERPC_INPUT_BookE (PPC_FLAGS_INPUT_BookE) 2576 #define POWERPC_INPUT_BookE (PPC_FLAGS_INPUT_BookE)
  2577 +#define POWERPC_BFDM_BookE (bfd_mach_ppc_403)
2561 2578
2562 static void init_proc_BookE (CPUPPCState *env) 2579 static void init_proc_BookE (CPUPPCState *env)
2563 { 2580 {
@@ -2581,6 +2598,7 @@ static void init_proc_BookE (CPUPPCState *env) @@ -2581,6 +2598,7 @@ static void init_proc_BookE (CPUPPCState *env)
2581 #define POWERPC_MMU_e500 (POWERPC_MMU_SOFT_4xx) 2598 #define POWERPC_MMU_e500 (POWERPC_MMU_SOFT_4xx)
2582 #define POWERPC_EXCP_e500 (POWERPC_EXCP_40x) 2599 #define POWERPC_EXCP_e500 (POWERPC_EXCP_40x)
2583 #define POWERPC_INPUT_e500 (PPC_FLAGS_INPUT_BookE) 2600 #define POWERPC_INPUT_e500 (PPC_FLAGS_INPUT_BookE)
  2601 +#define POWERPC_BFDM_e500 (bfd_mach_ppc_403)
2584 2602
2585 static void init_proc_e500 (CPUPPCState *env) 2603 static void init_proc_e500 (CPUPPCState *env)
2586 { 2604 {
@@ -2623,6 +2641,7 @@ static void init_proc_e500 (CPUPPCState *env) @@ -2623,6 +2641,7 @@ static void init_proc_e500 (CPUPPCState *env)
2623 //#define POWERPC_MMU_601 (POWERPC_MMU_601) 2641 //#define POWERPC_MMU_601 (POWERPC_MMU_601)
2624 //#define POWERPC_EXCP_601 (POWERPC_EXCP_601) 2642 //#define POWERPC_EXCP_601 (POWERPC_EXCP_601)
2625 #define POWERPC_INPUT_601 (PPC_FLAGS_INPUT_6xx) 2643 #define POWERPC_INPUT_601 (PPC_FLAGS_INPUT_6xx)
  2644 +#define POWERPC_BFDM_601 (bfd_mach_ppc_601)
2626 2645
2627 static void init_proc_601 (CPUPPCState *env) 2646 static void init_proc_601 (CPUPPCState *env)
2628 { 2647 {
@@ -2671,6 +2690,7 @@ static void init_proc_601 (CPUPPCState *env) @@ -2671,6 +2690,7 @@ static void init_proc_601 (CPUPPCState *env)
2671 #define POWERPC_MMU_602 (POWERPC_MMU_SOFT_6xx) 2690 #define POWERPC_MMU_602 (POWERPC_MMU_SOFT_6xx)
2672 //#define POWERPC_EXCP_602 (POWERPC_EXCP_602) 2691 //#define POWERPC_EXCP_602 (POWERPC_EXCP_602)
2673 #define POWERPC_INPUT_602 (PPC_FLAGS_INPUT_6xx) 2692 #define POWERPC_INPUT_602 (PPC_FLAGS_INPUT_6xx)
  2693 +#define POWERPC_BFDM_602 (bfd_mach_ppc_602)
2674 2694
2675 static void init_proc_602 (CPUPPCState *env) 2695 static void init_proc_602 (CPUPPCState *env)
2676 { 2696 {
@@ -2702,6 +2722,7 @@ static void init_proc_602 (CPUPPCState *env) @@ -2702,6 +2722,7 @@ static void init_proc_602 (CPUPPCState *env)
2702 #define POWERPC_MMU_603 (POWERPC_MMU_SOFT_6xx) 2722 #define POWERPC_MMU_603 (POWERPC_MMU_SOFT_6xx)
2703 //#define POWERPC_EXCP_603 (POWERPC_EXCP_603) 2723 //#define POWERPC_EXCP_603 (POWERPC_EXCP_603)
2704 #define POWERPC_INPUT_603 (PPC_FLAGS_INPUT_6xx) 2724 #define POWERPC_INPUT_603 (PPC_FLAGS_INPUT_6xx)
  2725 +#define POWERPC_BFDM_603 (bfd_mach_ppc_603)
2705 2726
2706 static void init_proc_603 (CPUPPCState *env) 2727 static void init_proc_603 (CPUPPCState *env)
2707 { 2728 {
@@ -2733,6 +2754,7 @@ static void init_proc_603 (CPUPPCState *env) @@ -2733,6 +2754,7 @@ static void init_proc_603 (CPUPPCState *env)
2733 #define POWERPC_MMU_603E (POWERPC_MMU_SOFT_6xx) 2754 #define POWERPC_MMU_603E (POWERPC_MMU_SOFT_6xx)
2734 //#define POWERPC_EXCP_603E (POWERPC_EXCP_603E) 2755 //#define POWERPC_EXCP_603E (POWERPC_EXCP_603E)
2735 #define POWERPC_INPUT_603E (PPC_FLAGS_INPUT_6xx) 2756 #define POWERPC_INPUT_603E (PPC_FLAGS_INPUT_6xx)
  2757 +#define POWERPC_BFDM_603E (bfd_mach_ppc_ec603e)
2736 2758
2737 static void init_proc_603E (CPUPPCState *env) 2759 static void init_proc_603E (CPUPPCState *env)
2738 { 2760 {
@@ -2769,6 +2791,7 @@ static void init_proc_603E (CPUPPCState *env) @@ -2769,6 +2791,7 @@ static void init_proc_603E (CPUPPCState *env)
2769 #define POWERPC_MMU_G2 (POWERPC_MMU_SOFT_6xx) 2791 #define POWERPC_MMU_G2 (POWERPC_MMU_SOFT_6xx)
2770 //#define POWERPC_EXCP_G2 (POWERPC_EXCP_G2) 2792 //#define POWERPC_EXCP_G2 (POWERPC_EXCP_G2)
2771 #define POWERPC_INPUT_G2 (PPC_FLAGS_INPUT_6xx) 2793 #define POWERPC_INPUT_G2 (PPC_FLAGS_INPUT_6xx)
  2794 +#define POWERPC_BFDM_G2 (bfd_mach_ppc_ec603e)
2772 2795
2773 static void init_proc_G2 (CPUPPCState *env) 2796 static void init_proc_G2 (CPUPPCState *env)
2774 { 2797 {
@@ -2807,6 +2830,7 @@ static void init_proc_G2 (CPUPPCState *env) @@ -2807,6 +2830,7 @@ static void init_proc_G2 (CPUPPCState *env)
2807 #define POWERPC_MMU_G2LE (POWERPC_MMU_SOFT_6xx) 2830 #define POWERPC_MMU_G2LE (POWERPC_MMU_SOFT_6xx)
2808 #define POWERPC_EXCP_G2LE (POWERPC_EXCP_G2) 2831 #define POWERPC_EXCP_G2LE (POWERPC_EXCP_G2)
2809 #define POWERPC_INPUT_G2LE (PPC_FLAGS_INPUT_6xx) 2832 #define POWERPC_INPUT_G2LE (PPC_FLAGS_INPUT_6xx)
  2833 +#define POWERPC_BFDM_G2LE (bfd_mach_ppc_ec603e)
2810 2834
2811 static void init_proc_G2LE (CPUPPCState *env) 2835 static void init_proc_G2LE (CPUPPCState *env)
2812 { 2836 {
@@ -2845,6 +2869,7 @@ static void init_proc_G2LE (CPUPPCState *env) @@ -2845,6 +2869,7 @@ static void init_proc_G2LE (CPUPPCState *env)
2845 #define POWERPC_MMU_604 (POWERPC_MMU_32B) 2869 #define POWERPC_MMU_604 (POWERPC_MMU_32B)
2846 //#define POWERPC_EXCP_604 (POWERPC_EXCP_604) 2870 //#define POWERPC_EXCP_604 (POWERPC_EXCP_604)
2847 #define POWERPC_INPUT_604 (PPC_FLAGS_INPUT_6xx) 2871 #define POWERPC_INPUT_604 (PPC_FLAGS_INPUT_6xx)
  2872 +#define POWERPC_BFDM_604 (bfd_mach_ppc_604)
2848 2873
2849 static void init_proc_604 (CPUPPCState *env) 2874 static void init_proc_604 (CPUPPCState *env)
2850 { 2875 {
@@ -2875,6 +2900,7 @@ static void init_proc_604 (CPUPPCState *env) @@ -2875,6 +2900,7 @@ static void init_proc_604 (CPUPPCState *env)
2875 #define POWERPC_MMU_7x0 (POWERPC_MMU_32B) 2900 #define POWERPC_MMU_7x0 (POWERPC_MMU_32B)
2876 //#define POWERPC_EXCP_7x0 (POWERPC_EXCP_7x0) 2901 //#define POWERPC_EXCP_7x0 (POWERPC_EXCP_7x0)
2877 #define POWERPC_INPUT_7x0 (PPC_FLAGS_INPUT_6xx) 2902 #define POWERPC_INPUT_7x0 (PPC_FLAGS_INPUT_6xx)
  2903 +#define POWERPC_BFDM_7x0 (bfd_mach_ppc_750)
2878 2904
2879 static void init_proc_7x0 (CPUPPCState *env) 2905 static void init_proc_7x0 (CPUPPCState *env)
2880 { 2906 {
@@ -2907,6 +2933,7 @@ static void init_proc_7x0 (CPUPPCState *env) @@ -2907,6 +2933,7 @@ static void init_proc_7x0 (CPUPPCState *env)
2907 #define POWERPC_MMU_750fx (POWERPC_MMU_32B) 2933 #define POWERPC_MMU_750fx (POWERPC_MMU_32B)
2908 #define POWERPC_EXCP_750fx (POWERPC_EXCP_7x0) 2934 #define POWERPC_EXCP_750fx (POWERPC_EXCP_7x0)
2909 #define POWERPC_INPUT_750fx (PPC_FLAGS_INPUT_6xx) 2935 #define POWERPC_INPUT_750fx (PPC_FLAGS_INPUT_6xx)
  2936 +#define POWERPC_BFDM_750fx (bfd_mach_ppc_750)
2910 2937
2911 static void init_proc_750fx (CPUPPCState *env) 2938 static void init_proc_750fx (CPUPPCState *env)
2912 { 2939 {
@@ -2946,6 +2973,7 @@ static void init_proc_750fx (CPUPPCState *env) @@ -2946,6 +2973,7 @@ static void init_proc_750fx (CPUPPCState *env)
2946 #define POWERPC_MMU_7x5 (POWERPC_MMU_SOFT_6xx) 2973 #define POWERPC_MMU_7x5 (POWERPC_MMU_SOFT_6xx)
2947 //#define POWERPC_EXCP_7x5 (POWERPC_EXCP_7x5) 2974 //#define POWERPC_EXCP_7x5 (POWERPC_EXCP_7x5)
2948 #define POWERPC_INPUT_7x5 (PPC_FLAGS_INPUT_6xx) 2975 #define POWERPC_INPUT_7x5 (PPC_FLAGS_INPUT_6xx)
  2976 +#define POWERPC_BFDM_7x5 (bfd_mach_ppc_750)
2949 2977
2950 static void init_proc_7x5 (CPUPPCState *env) 2978 static void init_proc_7x5 (CPUPPCState *env)
2951 { 2979 {
@@ -2996,6 +3024,7 @@ static void init_proc_7x5 (CPUPPCState *env) @@ -2996,6 +3024,7 @@ static void init_proc_7x5 (CPUPPCState *env)
2996 #define POWERPC_MMU_7400 (POWERPC_MMU_32B) 3024 #define POWERPC_MMU_7400 (POWERPC_MMU_32B)
2997 #define POWERPC_EXCP_7400 (POWERPC_EXCP_74xx) 3025 #define POWERPC_EXCP_7400 (POWERPC_EXCP_74xx)
2998 #define POWERPC_INPUT_7400 (PPC_FLAGS_INPUT_6xx) 3026 #define POWERPC_INPUT_7400 (PPC_FLAGS_INPUT_6xx)
  3027 +#define POWERPC_BFDM_7400 (bfd_mach_ppc_7400)
2999 3028
3000 static void init_proc_7400 (CPUPPCState *env) 3029 static void init_proc_7400 (CPUPPCState *env)
3001 { 3030 {
@@ -3021,6 +3050,7 @@ static void init_proc_7400 (CPUPPCState *env) @@ -3021,6 +3050,7 @@ static void init_proc_7400 (CPUPPCState *env)
3021 #define POWERPC_MMU_7410 (POWERPC_MMU_32B) 3050 #define POWERPC_MMU_7410 (POWERPC_MMU_32B)
3022 #define POWERPC_EXCP_7410 (POWERPC_EXCP_74xx) 3051 #define POWERPC_EXCP_7410 (POWERPC_EXCP_74xx)
3023 #define POWERPC_INPUT_7410 (PPC_FLAGS_INPUT_6xx) 3052 #define POWERPC_INPUT_7410 (PPC_FLAGS_INPUT_6xx)
  3053 +#define POWERPC_BFDM_7410 (bfd_mach_ppc_7400)
3024 3054
3025 static void init_proc_7410 (CPUPPCState *env) 3055 static void init_proc_7410 (CPUPPCState *env)
3026 { 3056 {
@@ -3059,6 +3089,7 @@ static void init_proc_7410 (CPUPPCState *env) @@ -3059,6 +3089,7 @@ static void init_proc_7410 (CPUPPCState *env)
3059 #define POWERPC_MMU_7440 (POWERPC_MMU_SOFT_74xx) 3089 #define POWERPC_MMU_7440 (POWERPC_MMU_SOFT_74xx)
3060 #define POWERPC_EXCP_7440 (POWERPC_EXCP_74xx) 3090 #define POWERPC_EXCP_7440 (POWERPC_EXCP_74xx)
3061 #define POWERPC_INPUT_7440 (PPC_FLAGS_INPUT_6xx) 3091 #define POWERPC_INPUT_7440 (PPC_FLAGS_INPUT_6xx)
  3092 +#define POWERPC_BFDM_7440 (bfd_mach_ppc_7400)
3062 3093
3063 static void init_proc_7440 (CPUPPCState *env) 3094 static void init_proc_7440 (CPUPPCState *env)
3064 { 3095 {
@@ -3120,6 +3151,7 @@ static void init_proc_7440 (CPUPPCState *env) @@ -3120,6 +3151,7 @@ static void init_proc_7440 (CPUPPCState *env)
3120 #define POWERPC_MMU_7450 (POWERPC_MMU_SOFT_74xx) 3151 #define POWERPC_MMU_7450 (POWERPC_MMU_SOFT_74xx)
3121 #define POWERPC_EXCP_7450 (POWERPC_EXCP_74xx) 3152 #define POWERPC_EXCP_7450 (POWERPC_EXCP_74xx)
3122 #define POWERPC_INPUT_7450 (PPC_FLAGS_INPUT_6xx) 3153 #define POWERPC_INPUT_7450 (PPC_FLAGS_INPUT_6xx)
  3154 +#define POWERPC_BFDM_7450 (bfd_mach_ppc_7400)
3123 3155
3124 static void init_proc_7450 (CPUPPCState *env) 3156 static void init_proc_7450 (CPUPPCState *env)
3125 { 3157 {
@@ -3183,6 +3215,7 @@ static void init_proc_7450 (CPUPPCState *env) @@ -3183,6 +3215,7 @@ static void init_proc_7450 (CPUPPCState *env)
3183 #define POWERPC_MMU_7445 (POWERPC_MMU_SOFT_74xx) 3215 #define POWERPC_MMU_7445 (POWERPC_MMU_SOFT_74xx)
3184 #define POWERPC_EXCP_7445 (POWERPC_EXCP_74xx) 3216 #define POWERPC_EXCP_7445 (POWERPC_EXCP_74xx)
3185 #define POWERPC_INPUT_7445 (PPC_FLAGS_INPUT_6xx) 3217 #define POWERPC_INPUT_7445 (PPC_FLAGS_INPUT_6xx)
  3218 +#define POWERPC_BFDM_7445 (bfd_mach_ppc_7400)
3186 3219
3187 static void init_proc_7445 (CPUPPCState *env) 3220 static void init_proc_7445 (CPUPPCState *env)
3188 { 3221 {
@@ -3278,6 +3311,7 @@ static void init_proc_7445 (CPUPPCState *env) @@ -3278,6 +3311,7 @@ static void init_proc_7445 (CPUPPCState *env)
3278 #define POWERPC_MMU_7455 (POWERPC_MMU_SOFT_74xx) 3311 #define POWERPC_MMU_7455 (POWERPC_MMU_SOFT_74xx)
3279 #define POWERPC_EXCP_7455 (POWERPC_EXCP_74xx) 3312 #define POWERPC_EXCP_7455 (POWERPC_EXCP_74xx)
3280 #define POWERPC_INPUT_7455 (PPC_FLAGS_INPUT_6xx) 3313 #define POWERPC_INPUT_7455 (PPC_FLAGS_INPUT_6xx)
  3314 +#define POWERPC_BFDM_7455 (bfd_mach_ppc_7400)
3281 3315
3282 static void init_proc_7455 (CPUPPCState *env) 3316 static void init_proc_7455 (CPUPPCState *env)
3283 { 3317 {
@@ -3375,6 +3409,7 @@ static void init_proc_7455 (CPUPPCState *env) @@ -3375,6 +3409,7 @@ static void init_proc_7455 (CPUPPCState *env)
3375 #define POWERPC_MMU_970 (POWERPC_MMU_64BRIDGE) 3409 #define POWERPC_MMU_970 (POWERPC_MMU_64BRIDGE)
3376 //#define POWERPC_EXCP_970 (POWERPC_EXCP_970) 3410 //#define POWERPC_EXCP_970 (POWERPC_EXCP_970)
3377 #define POWERPC_INPUT_970 (PPC_FLAGS_INPUT_970) 3411 #define POWERPC_INPUT_970 (PPC_FLAGS_INPUT_970)
  3412 +#define POWERPC_BFDM_970 (bfd_mach_ppc64)
3378 3413
3379 static void init_proc_970 (CPUPPCState *env) 3414 static void init_proc_970 (CPUPPCState *env)
3380 { 3415 {
@@ -3416,6 +3451,7 @@ static void init_proc_970 (CPUPPCState *env) @@ -3416,6 +3451,7 @@ static void init_proc_970 (CPUPPCState *env)
3416 #define POWERPC_MMU_970FX (POWERPC_MMU_64BRIDGE) 3451 #define POWERPC_MMU_970FX (POWERPC_MMU_64BRIDGE)
3417 #define POWERPC_EXCP_970FX (POWERPC_EXCP_970) 3452 #define POWERPC_EXCP_970FX (POWERPC_EXCP_970)
3418 #define POWERPC_INPUT_970FX (PPC_FLAGS_INPUT_970) 3453 #define POWERPC_INPUT_970FX (PPC_FLAGS_INPUT_970)
  3454 +#define POWERPC_BFDM_970FX (bfd_mach_ppc64)
3419 3455
3420 static void init_proc_970FX (CPUPPCState *env) 3456 static void init_proc_970FX (CPUPPCState *env)
3421 { 3457 {
@@ -3457,6 +3493,7 @@ static void init_proc_970FX (CPUPPCState *env) @@ -3457,6 +3493,7 @@ static void init_proc_970FX (CPUPPCState *env)
3457 #define POWERPC_MMU_970GX (POWERPC_MMU_64BRIDGE) 3493 #define POWERPC_MMU_970GX (POWERPC_MMU_64BRIDGE)
3458 #define POWERPC_EXCP_970GX (POWERPC_EXCP_970) 3494 #define POWERPC_EXCP_970GX (POWERPC_EXCP_970)
3459 #define POWERPC_INPUT_970GX (PPC_FLAGS_INPUT_970) 3495 #define POWERPC_INPUT_970GX (PPC_FLAGS_INPUT_970)
  3496 +#define POWERPC_BFDM_970GX (bfd_mach_ppc64)
3460 3497
3461 static void init_proc_970GX (CPUPPCState *env) 3498 static void init_proc_970GX (CPUPPCState *env)
3462 { 3499 {
@@ -3498,6 +3535,7 @@ static void init_proc_970GX (CPUPPCState *env) @@ -3498,6 +3535,7 @@ static void init_proc_970GX (CPUPPCState *env)
3498 #define POWERPC_MMU_620 (POWERPC_MMU_64B) 3535 #define POWERPC_MMU_620 (POWERPC_MMU_64B)
3499 #define POWERPC_EXCP_620 (POWERPC_EXCP_970) 3536 #define POWERPC_EXCP_620 (POWERPC_EXCP_970)
3500 #define POWERPC_INPUT_620 (PPC_FLAGS_INPUT_970) 3537 #define POWERPC_INPUT_620 (PPC_FLAGS_INPUT_970)
  3538 +#define POWERPC_BFDM_620 (bfd_mach_ppc64)
3501 3539
3502 static void init_proc_620 (CPUPPCState *env) 3540 static void init_proc_620 (CPUPPCState *env)
3503 { 3541 {
@@ -3527,6 +3565,7 @@ static void init_proc_620 (CPUPPCState *env) @@ -3527,6 +3565,7 @@ static void init_proc_620 (CPUPPCState *env)
3527 #define POWERPC_EXCP_PPC32 POWERPC_EXCP_604 3565 #define POWERPC_EXCP_PPC32 POWERPC_EXCP_604
3528 #define POWERPC_INPUT_PPC32 POWERPC_INPUT_604 3566 #define POWERPC_INPUT_PPC32 POWERPC_INPUT_604
3529 #define init_proc_PPC32 init_proc_604 3567 #define init_proc_PPC32 init_proc_604
  3568 +#define POWERPC_BFDM_PPC32 POWERPC_BFDM_604
3530 3569
3531 /* Default 64 bits PowerPC target will be 970 FX */ 3570 /* Default 64 bits PowerPC target will be 970 FX */
3532 #define CPU_POWERPC_PPC64 CPU_POWERPC_970FX 3571 #define CPU_POWERPC_PPC64 CPU_POWERPC_970FX
@@ -3536,6 +3575,7 @@ static void init_proc_620 (CPUPPCState *env) @@ -3536,6 +3575,7 @@ static void init_proc_620 (CPUPPCState *env)
3536 #define POWERPC_EXCP_PPC64 POWERPC_EXCP_970FX 3575 #define POWERPC_EXCP_PPC64 POWERPC_EXCP_970FX
3537 #define POWERPC_INPUT_PPC64 POWERPC_INPUT_970FX 3576 #define POWERPC_INPUT_PPC64 POWERPC_INPUT_970FX
3538 #define init_proc_PPC64 init_proc_970FX 3577 #define init_proc_PPC64 init_proc_970FX
  3578 +#define POWERPC_BFDM_PPC64 POWERPC_BFDM_970FX
3539 3579
3540 /* Default PowerPC target will be PowerPC 32 */ 3580 /* Default PowerPC target will be PowerPC 32 */
3541 #if defined (TARGET_PPC64) && 0 // XXX: TODO 3581 #if defined (TARGET_PPC64) && 0 // XXX: TODO
@@ -3546,6 +3586,7 @@ static void init_proc_620 (CPUPPCState *env) @@ -3546,6 +3586,7 @@ static void init_proc_620 (CPUPPCState *env)
3546 #define POWERPC_EXCP_DEFAULT POWERPC_EXCP_PPC64 3586 #define POWERPC_EXCP_DEFAULT POWERPC_EXCP_PPC64
3547 #define POWERPC_INPUT_DEFAULT POWERPC_INPUT_PPC64 3587 #define POWERPC_INPUT_DEFAULT POWERPC_INPUT_PPC64
3548 #define init_proc_DEFAULT init_proc_PPC64 3588 #define init_proc_DEFAULT init_proc_PPC64
  3589 +#define POWERPC_BFDM_DEFAULT POWERPC_BFDM_PPC64
3549 #else 3590 #else
3550 #define CPU_POWERPC_DEFAULT CPU_POWERPC_PPC32 3591 #define CPU_POWERPC_DEFAULT CPU_POWERPC_PPC32
3551 #define POWERPC_INSNS_DEFAULT POWERPC_INSNS_PPC32 3592 #define POWERPC_INSNS_DEFAULT POWERPC_INSNS_PPC32
@@ -3554,6 +3595,7 @@ static void init_proc_620 (CPUPPCState *env) @@ -3554,6 +3595,7 @@ static void init_proc_620 (CPUPPCState *env)
3554 #define POWERPC_EXCP_DEFAULT POWERPC_EXCP_PPC32 3595 #define POWERPC_EXCP_DEFAULT POWERPC_EXCP_PPC32
3555 #define POWERPC_INPUT_DEFAULT POWERPC_INPUT_PPC32 3596 #define POWERPC_INPUT_DEFAULT POWERPC_INPUT_PPC32
3556 #define init_proc_DEFAULT init_proc_PPC32 3597 #define init_proc_DEFAULT init_proc_PPC32
  3598 +#define POWERPC_BFDM_DEFAULT POWERPC_BFDM_PPC32
3557 #endif 3599 #endif
3558 3600
3559 /*****************************************************************************/ 3601 /*****************************************************************************/
@@ -4048,6 +4090,7 @@ enum { @@ -4048,6 +4090,7 @@ enum {
4048 .mmu_model = glue(POWERPC_MMU_,_type), \ 4090 .mmu_model = glue(POWERPC_MMU_,_type), \
4049 .excp_model = glue(POWERPC_EXCP_,_type), \ 4091 .excp_model = glue(POWERPC_EXCP_,_type), \
4050 .bus_model = glue(POWERPC_INPUT_,_type), \ 4092 .bus_model = glue(POWERPC_INPUT_,_type), \
  4093 + .bfd_mach = glue(POWERPC_BFDM_,_type), \
4051 .init_proc = &glue(init_proc_,_type), \ 4094 .init_proc = &glue(init_proc_,_type), \
4052 } 4095 }
4053 4096
@@ -5332,6 +5375,7 @@ int cpu_ppc_register (CPUPPCState *env, ppc_def_t *def) @@ -5332,6 +5375,7 @@ int cpu_ppc_register (CPUPPCState *env, ppc_def_t *def)
5332 env->mmu_model = def->mmu_model; 5375 env->mmu_model = def->mmu_model;
5333 env->excp_model = def->excp_model; 5376 env->excp_model = def->excp_model;
5334 env->bus_model = def->bus_model; 5377 env->bus_model = def->bus_model;
  5378 + env->bfd_mach = def->bfd_mach;
5335 if (create_ppc_opcodes(env, def) < 0) 5379 if (create_ppc_opcodes(env, def) < 0)
5336 return -1; 5380 return -1;
5337 init_ppc_proc(env, def); 5381 init_ppc_proc(env, def);