From ad3714e925f5c6b4ae0e0d31c4bab7f8c5e659db Mon Sep 17 00:00:00 2001
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
Date: Fri, 10 Aug 2012 21:55:41 +0200
Subject: [PATCH] hal/arm: fix compilation for thumb
include/asm-arm/atomic.h | 3 ++
ksrc/arch/arm/switch.S | 84 +++++++++++++++++++++++++++------------------
2 files changed, 53 insertions(+), 34 deletions(-)
diff --git a/include/asm-arm/atomic.h b/include/asm-arm/atomic.h
index 5d55ae8..ae96847 100644
--- a/include/asm-arm/atomic.h
+++ b/include/asm-arm/atomic.h
@@ -183,6 +183,9 @@ xnarch_atomic_cmpxchg(xnarch_atomic_t *ptr,
: "=&r" (res), "=&r" (curval), "+Qo" (ptr->counter)
: "r" (&ptr->counter), "Ir" (oldval), "r" (newval)
diff --git a/ksrc/arch/arm/switch.S b/ksrc/arch/arm/switch.S
index 83f4746..95c355f 100644
--- a/ksrc/arch/arm/switch.S
+++ b/ksrc/arch/arm/switch.S
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 37)
* r0 = pointer to union vfp_state, r1 = fpexc
- VFPFSTMIA r0, r2 @ save the working registers
- VFPFMRX r2, FPSCR @ current status
- tst r1, #FPEXC_EX @ is there additional state to save?
- VFPFMRX r3, FPINST @ FPINST (only if FPEXC.EX is set)
- tst r1, #FPEXC_FP2V @ is there an FPINST2 to read?
- VFPFMRX r12, FPINST2 @ FPINST2 if needed (and present)
+ VFPFSTMIA r0, r2 @ save the working registers
+ VFPFMRX r2, FPSCR @ current status
+ tst r1, #FPEXC_EX @ is there additional state to save?
+ VFPFMRX r3, FPINST @ FPINST (only if FPEXC.EX is set)
+ tst r1, #FPEXC_FP2V @ is there an FPINST2 to read?
+ VFPFMRX r12, FPINST2 @ FPINST2 if needed (and present)
- stmia r0, {r1, r2, r3, r12} @ save FPEXC, FPSCR, FPINST, FPINST2