Commit 48024e4a485fa82c103978c30c7d59d3a3a09262

Authored by bellard
1 parent b389dbfb

m68k disassembler (Paul Brook)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1605 c046a42c-6fe2-441c-8c8c-71466251a162

Too many changes to show.

To preserve performance only 4 of 6 files are displayed.

Makefile.target
... ... @@ -240,6 +240,9 @@ endif
240 240 ifeq ($(findstring arm, $(TARGET_ARCH) $(ARCH)),arm)
241 241 LIBOBJS+=arm-dis.o
242 242 endif
  243 +ifeq ($(findstring m68k, $(TARGET_ARCH) $(ARCH)),m68k)
  244 +LIBOBJS+=m68k-dis.o
  245 +endif
243 246  
244 247 ifeq ($(ARCH),ia64)
245 248 OBJS += ia64-syscall.o
... ...
alpha-dis.c
... ... @@ -23,9 +23,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 23 #include <stdio.h>
24 24 #include "dis-asm.h"
25 25  
26   -#define ATTRIBUTE_UNUSED __attribute__((unused))
27   -#define _(x) x
28   -
29 26 /* The opcode table is an array of struct alpha_opcode. */
30 27  
31 28 struct alpha_opcode
... ...
dis-asm.h
... ... @@ -56,6 +56,17 @@ enum bfd_architecture
56 56 #define bfd_mach_m68030 5
57 57 #define bfd_mach_m68040 6
58 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 70 bfd_arch_vax, /* DEC Vax */
60 71 bfd_arch_i960, /* Intel 960 */
61 72 /* The order of the following is important.
... ... @@ -417,6 +428,7 @@ extern int generic_symbol_at_address
417 428 (INFO).insn_info_valid = 0
418 429  
419 430 #define _(x) x
  431 +#define ATTRIBUTE_UNUSED __attribute__((unused))
420 432  
421 433 /* from libbfd */
422 434  
... ... @@ -425,5 +437,6 @@ bfd_vma bfd_getb32 (const bfd_byte *addr);
425 437 bfd_vma bfd_getl16 (const bfd_byte *addr);
426 438 bfd_vma bfd_getb16 (const bfd_byte *addr);
427 439 typedef enum bfd_boolean {false, true} boolean;
  440 +typedef boolean bfd_boolean;
428 441  
429 442 #endif /* ! defined (DIS_ASM_H) */
... ...
... ... @@ -187,6 +187,8 @@ void target_disas(FILE *out, target_ulong code, target_ulong size, int flags)
187 187 print_insn = print_insn_ppc;
188 188 #elif defined(TARGET_MIPS)
189 189 print_insn = print_insn_big_mips;
  190 +#elif defined(TARGET_M68K)
  191 + print_insn = print_insn_m68k;
190 192 #else
191 193 fprintf(out, "0x" TARGET_FMT_lx
192 194 ": Asm output not supported on this arch\n", code);
... ... @@ -251,6 +253,8 @@ void disas(FILE *out, void *code, unsigned long size)
251 253 print_insn = print_insn_big_mips;
252 254 #elif defined(__MIPSEL__)
253 255 print_insn = print_insn_little_mips;
  256 +#elif defined(__m68k__)
  257 + print_insn = print_insn_m68k;
254 258 #else
255 259 fprintf(out, "0x%lx: Asm output not supported on this arch\n",
256 260 (long) code);
... ... @@ -374,6 +378,8 @@ void monitor_disas(target_ulong pc, int nb_insn, int is_physical, int flags)
374 378 print_insn = print_insn_ppc;
375 379 #elif defined(TARGET_MIPS)
376 380 print_insn = print_insn_big_mips;
  381 +#elif defined(TARGET_M68K)
  382 + print_insn = print_insn_m68k;
377 383 #else
378 384 term_printf("0x" TARGET_FMT_lx
379 385 ": Asm output not supported on this arch\n", pc);
... ...