Source-Changes-HG archive

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

[src/netbsd-3-0]: src/sys/arch/acorn26/acorn26 Pull up following revision(s) ...



details:   https://anonhg.NetBSD.org/src/rev/4f6a574374c8
branches:  netbsd-3-0
changeset: 579313:4f6a574374c8
user:      ghen <ghen%NetBSD.org@localhost>
date:      Mon Oct 23 19:29:02 2006 +0000

description:
Pull up following revision(s) (requested by bjh21 in ticket #1552):
        sys/arch/acorn26/acorn26/except.c: revision 1.17
Correctly calculate fault addresses for instructions like:
        ldr     rX, [rY, rZ, ror #16]
and even:
        ldr     rX, [rY, rZ, rrx]
Why anyone would want such an instruction is beyond me, but it's nice not to
panic if they do.  Also this makes regress/sys/arch/arm/abort-fixup pass.

diffstat:

 sys/arch/acorn26/acorn26/except.c |  16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diffs (44 lines):

diff -r 4056a166d83e -r 4f6a574374c8 sys/arch/acorn26/acorn26/except.c
--- a/sys/arch/acorn26/acorn26/except.c Mon Oct 23 18:00:56 2006 +0000
+++ b/sys/arch/acorn26/acorn26/except.c Mon Oct 23 19:29:02 2006 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: except.c,v 1.7 2003/11/30 13:22:32 bjh21 Exp $ */
+/* $NetBSD: except.c,v 1.7.18.1 2006/10/23 19:29:02 ghen Exp $ */
 /*-
  * Copyright (c) 1998, 1999, 2000 Ben Harris
  * All rights reserved.
@@ -31,7 +31,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: except.c,v 1.7 2003/11/30 13:22:32 bjh21 Exp $");
+__KERNEL_RCSID(0, "$NetBSD: except.c,v 1.7.18.1 2006/10/23 19:29:02 ghen Exp $");
 
 #include "opt_ddb.h"
 #include "opt_ktrace.h"
@@ -318,7 +318,7 @@
                        /* immediate shift */
                        shift = (insn & 0x00000f80) >> 7;
                else
-                       goto croak; /* register shifts can't happen in ARMv2 */
+                       goto croak; /* Undefined instruction */
                switch ((insn & 0x00000060) >> 5) {
                case 0: /* Logical left */
                        offset = (int)(((u_int)offset) << shift);
@@ -331,9 +331,13 @@
                        if (shift == 0) shift = 32;
                        offset = (int)(((int)offset) >> shift);
                        break;
-               case 3: /* Rotate right -- FIXME support this*/
-               default: /* help GCC */
-                       goto croak;
+               case 3:
+                       if (shift == 0) /* Rotate Right Extended */
+                               offset = (int)((tf->tf_r15 & R15_FLAG_C) << 2 |
+                                   ((u_int)offset) >> 1);
+                       else /* Rotate Right */
+                               offset = (int)((u_int)offset >> shift |
+                                   (u_int)offset << (32 - shift));
                }
                if (u == 0)
                        return base - offset;



Home | Main Index | Thread Index | Old Index