diff -r 67e476e04669 configure.in --- a/configure.in Fri Nov 12 20:02:04 2010 +0100 +++ b/configure.in Fri Feb 18 21:47:58 2011 +0100 @@ -828,6 +828,16 @@ AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking Disables generation of dependency information. ],,) +AC_ARG_WITH(arm-target, +[ --arm-target The minimal targeted arm processor + used for the build environment. + Cases : + arm-target < 6 : compatibility with all arm supported by gcc + arm-target = 6 : exact armv6 compatibility + arm-target > 6 : armv7-a will be assumed. + + Usage: --with-arm-target=7 +],with_arm_target=$withval,with_arm_target=7) BUILD_TYPE="OOo" @@ -5803,6 +5813,26 @@ AC_SUBST(GSTREAMER_CFLAGS) AC_SUBST(GSTREAMER_LIBS) +dnl =================================================================== +dnl Check the ARM target (Linux ARM only). +dnl =================================================================== + +if test "$_os" = "Linux" -a test "build_cpu" = "arm" ; then + # default value + ARM_TARGET=7 + AC_MSG_CHECKING([whether to enable the minimal arm processor target on Linux ARM]) + if test "x$with_arm_target" < "x6" + then AC_MSG_RESULT([arm target is armv5 or inferior]) + ARM_TARGET=5 + elif test "x + if test "x$with_arm_target" = "x6" + then AC_MSG_RESULT([arm target is armv6]) + ARM_TARGET=6 + else + AC_MSG_RESULT([no, keep armv7-a as default]) + fi + AC_SUBST(ARM_TARGET) +fi dnl =================================================================== dnl Check whether the Cairo libraries are available. diff -r 67e476e04669 sal/osl/unx/interlck.c --- a/sal/osl/unx/interlck.c Fri Nov 12 20:02:04 2010 +0100 +++ b/sal/osl/unx/interlck.c Fri Feb 18 21:47:58 2011 +0100 @@ -134,6 +134,54 @@ return nCount; } +#elif defined ( GCC ) && defined ( ARM ) + +/*****************************************************************************/ +/* osl_incrementInterlockedCount */ +/*****************************************************************************/ +oslInterlockedCount SAL_CALL osl_incrementInterlockedCount(oslInterlockedCount* pCount) +{ +#if defined( ARMV7 ) || defined( ARMV6 ) + register oslInterlockedCount nCount __asm__ ("r1"); + int nResult; + + __asm__ __volatile__ ( +"1: ldrex %0, [%3]\n" +" add %0, %0, #1\n" +" strex %1, %0, [%3]\n" +" teq %1, #0\n" +" bne 1b" + : "=&r" (nCount), "=&r" (nResult), "=m" (*pCount) + : "r" (pCount) + : "memory"); + + return nCount; +#else + return __sync_add_and_fetch( pCount, 1 ); +#endif +} + +oslInterlockedCount SAL_CALL osl_decrementInterlockedCount(oslInterlockedCount* pCount) +{ +#if defined( ARMV7 ) || defined( ARMV6 ) + register oslInterlockedCount nCount __asm__ ("r1"); + int nResult; + + __asm__ __volatile__ ( +"0: ldrex %0, [%3]\n" +" sub %0, %0, #1\n" +" strex %1, %0, [%3]\n" +" teq %1, #0\n" +" bne 0b" + : "=&r" (nCount), "=&r" (nResult), "=m" (*pCount) + : "r" (pCount) + : "memory"); + return nCount; +#else + return __sync_sub_and_fetch( pCount, 1 ); +#endif +} + #else /* use only if nothing else works, expensive due to single mutex for all reference counts */ diff -r 67e476e04669 set_soenv.in --- a/set_soenv.in Fri Nov 12 20:02:04 2010 +0100 +++ b/set_soenv.in Fri Feb 18 21:47:58 2011 +0100 @@ -1694,6 +1694,7 @@ ToFile( "SET_EXCEPTIONS", $SET_EXCEPTIONS, "e" ); ToFile( "use_shl_versions", $use_shl_versions, "e" ); ToFile( "FLIPCMD", $FLIPCMD, "e" ); +ToFile( "ARM_TARGET", "@ARM_TARGET@", "e" ); # # Writing the variables to file. # (c = comment, e = environment variable, a = alias, n = newline ) diff -r 67e476e04669 solenv/inc/unxlngr.mk --- a/solenv/inc/unxlngr.mk Fri Nov 12 20:02:04 2010 +0100 +++ b/solenv/inc/unxlngr.mk Fri Feb 18 21:47:58 2011 +0100 @@ -32,3 +32,18 @@ CDEFS+=-DARM32 CFLAGS+=-fno-omit-frame-pointer DLLPOSTFIX=lr + +# Default is armv7 mini. If you build +# for an older version (could be slow), +# please adapt to your needs + +.IF "$(ARM_TARGET)" == "ARMV6" +ARCH_FLAGS+=-march=armv6 -mfloat-abi=softfp -D__SOFTFP__ +CDEFS+=-DARMV6 +.ENDIF + +.IF "$(ARM_TARGET)" == "ARMV7" +ARCH_FLAGS+=-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -D__SOFTFP__ +CDEFS+=-DARMV7 +.ENDIF +