Commit 48024e4a485fa82c103978c30c7d59d3a3a09262
1 parent
b389dbfb
m68k disassembler (Paul Brook)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1605 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
4 changed files
with
22 additions
and
3 deletions
Too many changes to show.
To preserve performance only 4 of 6 files are displayed.
Makefile.target
| @@ -240,6 +240,9 @@ endif | @@ -240,6 +240,9 @@ endif | ||
| 240 | ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm) | 240 | ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm) |
| 241 | LIBOBJS+=arm-dis.o | 241 | LIBOBJS+=arm-dis.o |
| 242 | endif | 242 | endif |
| 243 | +ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k) | ||
| 244 | +LIBOBJS+=m68k-dis.o | ||
| 245 | +endif | ||
| 243 | 246 | ||
| 244 | ifeq ($(ARCH),ia64) | 247 | ifeq ($(ARCH),ia64) |
| 245 | OBJS += ia64-syscall.o | 248 | OBJS += ia64-syscall.o |
alpha-dis.c
| @@ -23,9 +23,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA | @@ -23,9 +23,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA | ||
| 23 | #include <stdio.h> | 23 | #include <stdio.h> |
| 24 | #include "dis-asm.h" | 24 | #include "dis-asm.h" |
| 25 | 25 | ||
| 26 | -#define ATTRIBUTE_UNUSED __attribute__((unused)) | ||
| 27 | -#define _(x) x | ||
| 28 | - | ||
| 29 | /* The opcode table is an array of struct alpha_opcode. */ | 26 | /* The opcode table is an array of struct alpha_opcode. */ |
| 30 | 27 | ||
| 31 | struct alpha_opcode | 28 | struct alpha_opcode |
dis-asm.h
| @@ -56,6 +56,17 @@ enum bfd_architecture | @@ -56,6 +56,17 @@ enum bfd_architecture | ||
| 56 | #define bfd_mach_m68030 5 | 56 | #define bfd_mach_m68030 5 |
| 57 | #define bfd_mach_m68040 6 | 57 | #define bfd_mach_m68040 6 |
| 58 | #define bfd_mach_m68060 7 | 58 | #define bfd_mach_m68060 7 |
| 59 | +#define bfd_mach_cpu32 8 | ||
| 60 | +#define bfd_mach_mcf5200 9 | ||
| 61 | +#define bfd_mach_mcf5206e 10 | ||
| 62 | +#define bfd_mach_mcf5307 11 | ||
| 63 | +#define bfd_mach_mcf5407 12 | ||
| 64 | +#define bfd_mach_mcf528x 13 | ||
| 65 | +#define bfd_mach_mcfv4e 14 | ||
| 66 | +#define bfd_mach_mcf521x 15 | ||
| 67 | +#define bfd_mach_mcf5249 16 | ||
| 68 | +#define bfd_mach_mcf547x 17 | ||
| 69 | +#define bfd_mach_mcf548x 18 | ||
| 59 | bfd_arch_vax, /* DEC Vax */ | 70 | bfd_arch_vax, /* DEC Vax */ |
| 60 | bfd_arch_i960, /* Intel 960 */ | 71 | bfd_arch_i960, /* Intel 960 */ |
| 61 | /* The order of the following is important. | 72 | /* The order of the following is important. |
| @@ -417,6 +428,7 @@ extern int generic_symbol_at_address | @@ -417,6 +428,7 @@ extern int generic_symbol_at_address | ||
| 417 | (INFO).insn_info_valid = 0 | 428 | (INFO).insn_info_valid = 0 |
| 418 | 429 | ||
| 419 | #define _(x) x | 430 | #define _(x) x |
| 431 | +#define ATTRIBUTE_UNUSED __attribute__((unused)) | ||
| 420 | 432 | ||
| 421 | /* from libbfd */ | 433 | /* from libbfd */ |
| 422 | 434 | ||
| @@ -425,5 +437,6 @@ bfd_vma bfd_getb32 (const bfd_byte *addr); | @@ -425,5 +437,6 @@ bfd_vma bfd_getb32 (const bfd_byte *addr); | ||
| 425 | bfd_vma bfd_getl16 (const bfd_byte *addr); | 437 | bfd_vma bfd_getl16 (const bfd_byte *addr); |
| 426 | bfd_vma bfd_getb16 (const bfd_byte *addr); | 438 | bfd_vma bfd_getb16 (const bfd_byte *addr); |
| 427 | typedef enum bfd_boolean {false, true} boolean; | 439 | typedef enum bfd_boolean {false, true} boolean; |
| 440 | +typedef boolean bfd_boolean; | ||
| 428 | 441 | ||
| 429 | #endif /* ! defined (DIS_ASM_H) */ | 442 | #endif /* ! defined (DIS_ASM_H) */ |
disas.c
| @@ -187,6 +187,8 @@ void target_disas(FILE *out, target_ulong code, target_ulong size, int flags) | @@ -187,6 +187,8 @@ void target_disas(FILE *out, target_ulong code, target_ulong size, int flags) | ||
| 187 | print_insn = print_insn_ppc; | 187 | print_insn = print_insn_ppc; |
| 188 | #elif defined(TARGET_MIPS) | 188 | #elif defined(TARGET_MIPS) |
| 189 | print_insn = print_insn_big_mips; | 189 | print_insn = print_insn_big_mips; |
| 190 | +#elif defined(TARGET_M68K) | ||
| 191 | + print_insn = print_insn_m68k; | ||
| 190 | #else | 192 | #else |
| 191 | fprintf(out, "0x" TARGET_FMT_lx | 193 | fprintf(out, "0x" TARGET_FMT_lx |
| 192 | ": Asm output not supported on this arch\n", code); | 194 | ": Asm output not supported on this arch\n", code); |
| @@ -251,6 +253,8 @@ void disas(FILE *out, void *code, unsigned long size) | @@ -251,6 +253,8 @@ void disas(FILE *out, void *code, unsigned long size) | ||
| 251 | print_insn = print_insn_big_mips; | 253 | print_insn = print_insn_big_mips; |
| 252 | #elif defined(__MIPSEL__) | 254 | #elif defined(__MIPSEL__) |
| 253 | print_insn = print_insn_little_mips; | 255 | print_insn = print_insn_little_mips; |
| 256 | +#elif defined(__m68k__) | ||
| 257 | + print_insn = print_insn_m68k; | ||
| 254 | #else | 258 | #else |
| 255 | fprintf(out, "0x%lx: Asm output not supported on this arch\n", | 259 | fprintf(out, "0x%lx: Asm output not supported on this arch\n", |
| 256 | (long) code); | 260 | (long) code); |
| @@ -374,6 +378,8 @@ void monitor_disas(target_ulong pc, int nb_insn, int is_physical, int flags) | @@ -374,6 +378,8 @@ void monitor_disas(target_ulong pc, int nb_insn, int is_physical, int flags) | ||
| 374 | print_insn = print_insn_ppc; | 378 | print_insn = print_insn_ppc; |
| 375 | #elif defined(TARGET_MIPS) | 379 | #elif defined(TARGET_MIPS) |
| 376 | print_insn = print_insn_big_mips; | 380 | print_insn = print_insn_big_mips; |
| 381 | +#elif defined(TARGET_M68K) | ||
| 382 | + print_insn = print_insn_m68k; | ||
| 377 | #else | 383 | #else |
| 378 | term_printf("0x" TARGET_FMT_lx | 384 | term_printf("0x" TARGET_FMT_lx |
| 379 | ": Asm output not supported on this arch\n", pc); | 385 | ": Asm output not supported on this arch\n", pc); |