Patchwork [02/12] S/390 disassembler fixes

login
register
mail settings
Submitter Ulrich Hecht
Date Oct. 21, 2009, 1:52 p.m.
Message ID <1256133153-3121-3-git-send-email-uli@suse.de>
Download mbox | patch
Permalink /patch/36602/
State New
Headers show

Comments

Ulrich Hecht - Oct. 21, 2009, 1:52 p.m.
enable zArch (64-bit) instructions
enable disassembler for both s390 and s390x

Signed-off-by: Ulrich Hecht <uli@suse.de>
---
 configure  |    2 +-
 disas.c    |    3 +++
 s390-dis.c |    4 ++--
 3 files changed, 6 insertions(+), 3 deletions(-)
Aurelien Jarno - Oct. 22, 2009, 9:51 p.m.
On Wed, Oct 21, 2009 at 03:52:23PM +0200, Ulrich Hecht wrote:
> enable zArch (64-bit) instructions
> enable disassembler for both s390 and s390x
> 
> Signed-off-by: Ulrich Hecht <uli@suse.de>
> ---
>  configure  |    2 +-
>  disas.c    |    3 +++
>  s390-dis.c |    4 ++--
>  3 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/configure b/configure
> index ca6d45c..350c742 100755
> --- a/configure
> +++ b/configure
> @@ -2386,7 +2386,7 @@ for i in $ARCH $TARGET_BASE_ARCH ; do
>    ppc*)
>      echo "CONFIG_PPC_DIS=y"  >> $config_target_mak
>    ;;
> -  s390)
> +  s390*)
>      echo "CONFIG_S390_DIS=y"  >> $config_target_mak
>    ;;
>    sh4)
> diff --git a/disas.c b/disas.c
> index ce342bc..14c8901 100644
> --- a/disas.c
> +++ b/disas.c
> @@ -195,6 +195,9 @@ void target_disas(FILE *out, target_ulong code, target_ulong size, int flags)
>  #elif defined(TARGET_CRIS)
>      disasm_info.mach = bfd_mach_cris_v32;
>      print_insn = print_insn_crisv32;
> +#elif defined(TARGET_S390X)
> +    disasm_info.mach = bfd_mach_s390_64;
> +    print_insn = print_insn_s390;
>  #elif defined(TARGET_MICROBLAZE)
>      disasm_info.mach = bfd_arch_microblaze;
>      print_insn = print_insn_microblaze;
> diff --git a/s390-dis.c b/s390-dis.c
> index 86dd84f..9a73a57 100644
> --- a/s390-dis.c
> +++ b/s390-dis.c
> @@ -191,10 +191,10 @@ init_disasm (struct disassemble_info *info)
>  //  switch (info->mach)
>  //    {
>  //    case bfd_mach_s390_31:
> -      current_arch_mask = 1 << S390_OPCODE_ESA;
> +//      current_arch_mask = 1 << S390_OPCODE_ESA;
>  //      break;
>  //    case bfd_mach_s390_64:
> -//      current_arch_mask = 1 << S390_OPCODE_ZARCH;
> +      current_arch_mask = 1 << S390_OPCODE_ZARCH;
>  //      break;
>  //    default:
>  //      abort ();

I do wonder why we keep everything commented, and not use the case at
all? Especially given above, the code does:

    disasm_info.mach = bfd_mach_s390_64;

Patch

diff --git a/configure b/configure
index ca6d45c..350c742 100755
--- a/configure
+++ b/configure
@@ -2386,7 +2386,7 @@  for i in $ARCH $TARGET_BASE_ARCH ; do
   ppc*)
     echo "CONFIG_PPC_DIS=y"  >> $config_target_mak
   ;;
-  s390)
+  s390*)
     echo "CONFIG_S390_DIS=y"  >> $config_target_mak
   ;;
   sh4)
diff --git a/disas.c b/disas.c
index ce342bc..14c8901 100644
--- a/disas.c
+++ b/disas.c
@@ -195,6 +195,9 @@  void target_disas(FILE *out, target_ulong code, target_ulong size, int flags)
 #elif defined(TARGET_CRIS)
     disasm_info.mach = bfd_mach_cris_v32;
     print_insn = print_insn_crisv32;
+#elif defined(TARGET_S390X)
+    disasm_info.mach = bfd_mach_s390_64;
+    print_insn = print_insn_s390;
 #elif defined(TARGET_MICROBLAZE)
     disasm_info.mach = bfd_arch_microblaze;
     print_insn = print_insn_microblaze;
diff --git a/s390-dis.c b/s390-dis.c
index 86dd84f..9a73a57 100644
--- a/s390-dis.c
+++ b/s390-dis.c
@@ -191,10 +191,10 @@  init_disasm (struct disassemble_info *info)
 //  switch (info->mach)
 //    {
 //    case bfd_mach_s390_31:
-      current_arch_mask = 1 << S390_OPCODE_ESA;
+//      current_arch_mask = 1 << S390_OPCODE_ESA;
 //      break;
 //    case bfd_mach_s390_64:
-//      current_arch_mask = 1 << S390_OPCODE_ZARCH;
+      current_arch_mask = 1 << S390_OPCODE_ZARCH;
 //      break;
 //    default:
 //      abort ();