Ticket #790: 0001-arm-allow-compilation-for-specific-ARMv5-architecture_cleaner.patch

File 0001-arm-allow-compilation-for-specific-ARMv5-architecture_cleaner.patch, 2.6 KB (added by dromi, 19 months ago)
  • configure.ac

    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  
    230230                    [pulseaudio_cv_support_arm_atomic_ops=no]) 
    231231                 ]) 
    232232               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.]) 
    234234                   need_libatomic_ops=no 
    235235                 ]) 
    236236           fi 
  • src/pulsecore/atomic.h

    diff --git a/src/pulsecore/atomic.h b/src/pulsecore/atomic.h
    index 51d0821..6eda64a 100644
    a b  
    360360    return result == old_p; 
    361361} 
    362362 
    363 #elif defined(ATOMIC_ARM_INLINE_ASM) 
     363#elif defined(ARMV6_ASM) 
    364364 
    365365/* 
    366366   These should only be enabled if we have ARMv6 or better. 
  • src/pulsecore/svolume_arm.c

    diff --git a/src/pulsecore/svolume_arm.c b/src/pulsecore/svolume_arm.c
    index fdd8f09..28cdd39 100644
    a b  
    3535#include "sample-util.h" 
    3636#include "endianmacros.h" 
    3737 
    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*/ 
    3942 
    4043#define MOD_INC() \ 
    4144    " subs  r0, r6, %2              \n\t" \ 
     
    182185} 
    183186#endif 
    184187 
    185 #endif /* defined (__arm__) */ 
     188#endif /* defined (__arm__) && defined (ARMV6_ASM) */ 
    186189 
    187190 
    188191void pa_volume_func_init_arm (pa_cpu_arm_flag_t flags) { 
    189 #if defined (__arm__) 
     192#if defined (__arm__) && defined (ARMV6_ASM) 
    190193    pa_log_info("Initialising ARM optimized functions."); 
    191194 
    192195#ifdef RUN_TEST 
     
    194197#endif 
    195198 
    196199    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) */ 
    198201}