Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/include ldrht is v6t2 or later so use ldrt and ...



details:   https://anonhg.NetBSD.org/src/rev/23c452d59bb4
branches:  trunk
changeset: 793205:23c452d59bb4
user:      matt <matt%NetBSD.org@localhost>
date:      Thu Jan 30 06:38:00 2014 +0000

description:
ldrht is v6t2 or later so use ldrt and extract the right halfword.

diffstat:

 sys/arch/arm/include/locore.h |  9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diffs (20 lines):

diff -r 86561f14f707 -r 23c452d59bb4 sys/arch/arm/include/locore.h
--- a/sys/arch/arm/include/locore.h     Thu Jan 30 02:51:41 2014 +0000
+++ b/sys/arch/arm/include/locore.h     Thu Jan 30 06:38:00 2014 +0000
@@ -197,7 +197,16 @@
        va &= ~1;
        uint32_t insn;
        if (user_p) {
+#ifdef _ARM_ARCH_T2
                __asm __volatile("ldrht %0, [%1]" : "=&r"(insn) : "r"(va));
+#else
+               __asm __volatile("ldrt %0, [%1]" : "=&r"(insn) : "r"(va & ~3));
+#ifdef __ARMEB__
+               insn = (uint16_t) (insn >> (((va ^ 2) & 2) << 3));
+#else
+               insn = (uint16_t) (insn >> ((va & 2) << 3));
+#endif
+#endif
        } else {
                insn = *(const uint16_t *)va;
        }



Home | Main Index | Thread Index | Old Index