From 29b8b20fd54dee4df6a405802b5ffe62b8a4f1a6 Mon Sep 17 00:00:00 2001
From: Alexandre Relange <alexandre.relange@gmail.com>
Date: Fri, 15 Oct 2010 12:44:57 +0200
Subject: [PATCH] arm: allow compilation for specific ARMv5 architecture
Removed ARMv6 assember specific code with preprocessor macros.
Replaced ATOMIC_ARM_INLINE_ASM specific macro with ARMV6_ASM more
explicit.
---
configure.ac | 2 +-
src/pulsecore/atomic.h | 2 +-
src/pulsecore/svolume_arm.c | 11 +++++++----
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/configure.ac b/configure.ac
index 7ab42dc..01d9bc2 100644
|
a
|
b
|
|
| 230 | 230 | [pulseaudio_cv_support_arm_atomic_ops=no]) |
| 231 | 231 | ]) |
| 232 | 232 | AS_IF([test "$pulseaudio_cv_support_arm_atomic_ops" = "yes"], [ |
| 233 | | AC_DEFINE([ATOMIC_ARM_INLINE_ASM], 1, [Have ARMv6 instructions.]) |
| | 233 | AC_DEFINE([ARMV6_ASM], 1, [Have ARMv6 instructions.]) |
| 234 | 234 | need_libatomic_ops=no |
| 235 | 235 | ]) |
| 236 | 236 | fi |
diff --git a/src/pulsecore/atomic.h b/src/pulsecore/atomic.h
index 51d0821..6eda64a 100644
|
a
|
b
|
|
| 360 | 360 | return result == old_p; |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | | #elif defined(ATOMIC_ARM_INLINE_ASM) |
| | 363 | #elif defined(ARMV6_ASM) |
| 364 | 364 | |
| 365 | 365 | /* |
| 366 | 366 | These should only be enabled if we have ARMv6 or better. |
diff --git a/src/pulsecore/svolume_arm.c b/src/pulsecore/svolume_arm.c
index fdd8f09..28cdd39 100644
|
a
|
b
|
|
| 35 | 35 | #include "sample-util.h" |
| 36 | 36 | #include "endianmacros.h" |
| 37 | 37 | |
| 38 | | #if defined (__arm__) |
| | 38 | #if defined (__arm__) && defined (ARMV6_ASM) |
| | 39 | /* |
| | 40 | These functions are removed if explicitly compiled for an architecture that cannot understand ARMV6 instructions (SSAT and PKHBT) |
| | 41 | */ |
| 39 | 42 | |
| 40 | 43 | #define MOD_INC() \ |
| 41 | 44 | " subs r0, r6, %2 \n\t" \ |
| … |
… |
|
| 182 | 185 | } |
| 183 | 186 | #endif |
| 184 | 187 | |
| 185 | | #endif /* defined (__arm__) */ |
| | 188 | #endif /* defined (__arm__) && defined (ARMV6_ASM) */ |
| 186 | 189 | |
| 187 | 190 | |
| 188 | 191 | void pa_volume_func_init_arm (pa_cpu_arm_flag_t flags) { |
| 189 | | #if defined (__arm__) |
| | 192 | #if defined (__arm__) && defined (ARMV6_ASM) |
| 190 | 193 | pa_log_info("Initialising ARM optimized functions."); |
| 191 | 194 | |
| 192 | 195 | #ifdef RUN_TEST |
| … |
… |
|
| 194 | 197 | #endif |
| 195 | 198 | |
| 196 | 199 | pa_set_volume_func (PA_SAMPLE_S16NE, (pa_do_volume_func_t) pa_volume_s16ne_arm); |
| 197 | | #endif /* defined (__arm__) */ |
| | 200 | #endif /* defined (__arm__) && defined (ARMV6_ASM) */ |
| 198 | 201 | } |