Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/arm Adjust the output of {ldr, str}x instruction...



details:   https://anonhg.NetBSD.org/src/rev/e0f15bbc404a
branches:  trunk
changeset: 824375:e0f15bbc404a
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sat Jun 03 11:51:59 2017 +0000

description:
Adjust the output of {ldr,str}x instructions slightly and deal with the
writeback bit.

diffstat:

 sys/arch/arm/arm/disassem.c |  17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diffs (49 lines):

diff -r 4660af9bbe9c -r e0f15bbc404a sys/arch/arm/arm/disassem.c
--- a/sys/arch/arm/arm/disassem.c       Sat Jun 03 11:23:01 2017 +0000
+++ b/sys/arch/arm/arm/disassem.c       Sat Jun 03 11:51:59 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: disassem.c,v 1.38 2017/06/02 21:20:47 skrll Exp $      */
+/*     $NetBSD: disassem.c,v 1.39 2017/06/03 11:51:59 skrll Exp $      */
 
 /*
  * Copyright (c) 1996 Mark Brinicombe.
@@ -49,7 +49,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: disassem.c,v 1.38 2017/06/02 21:20:47 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disassem.c,v 1.39 2017/06/03 11:51:59 skrll Exp $");
 
 #include <sys/systm.h>
 
@@ -203,6 +203,7 @@
     /* A5.2 exceptions */
 
     /* A5.2.7 Halfword multiply and multiply accumulate */
+
     /* A5.2.9 Extra load/store instructions, unprivileged */
 
     { 0x0f3000f0, 0x002000b0, "strht", "de" },
@@ -898,15 +899,17 @@
                di->di_printf("[r%d", (insn >> 16) & 0x0f);
                if ((insn & 0x01400f0f) != 0x01400000) {
                        di->di_printf("%s, ", (insn & (1 << 24)) ? "" : "]");
-                       if (!(insn & 0x00800000))
-                               di->di_printf("-");
+                       char const *sign = (insn & 0x00800000) ? "" : "-";
                        if (insn & (1 << 22))
-                               di->di_printf("#0x%02x", offset);
+                               di->di_printf("#%s0x%02x", sign, offset);
                        else
-                               di->di_printf("r%d", (insn & 0x0f));
+                               di->di_printf("%sr%d", sign, (insn & 0x0f));
                }
-               if (insn & (1 << 24))
+               if (insn & (1 << 24)) {
                        di->di_printf("]");
+                       if (__SHIFTOUT(insn, __BIT(21)))
+                               di->di_printf("!");
+               }
        }
 }
 



Home | Main Index | Thread Index | Old Index