b=429387, add --with-arm-kuser; use it in JS, and pass it down to NSPR's configure; r=shaver,r=ted

This commit is contained in:
Vladimir Vukicevic 2008-06-04 14:14:11 -07:00
parent 7e1e1fc126
commit e8feeb2011
3 changed files with 34 additions and 1 deletions

View File

@ -4255,6 +4255,18 @@ MOZ_ARG_WITH_STRING(java-bin-path,
[ --with-java-bin-path=dir Location of Java binaries (java, javac, jar)],
JAVA_BIN_PATH=$withval)
dnl ========================================================
dnl Use ARM userspace kernel helpers; tell NSPR to enable
dnl their usage and use them in spidermonkey.
dnl ========================================================
MOZ_ARG_WITH_BOOL(arm-kuser,
[ --with-arm-kuser Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)],
USE_ARM_KUSER=1,
USE_ARM_KUSER=)
if test -n "$USE_ARM_KUSER"; then
AC_DEFINE(USE_ARM_KUSER)
fi
dnl ========================================================
dnl =
dnl = Application
@ -8264,6 +8276,9 @@ if test -z "$MOZ_NATIVE_NSPR" || test "$MOZ_LDAP_XPCOM"; then
if test -n "$HAVE_64BIT_OS"; then
ac_configure_args="$ac_configure_args --enable-64bit"
fi
if test -n "$USE_ARM_KUSER"; then
ac_configure_args="$ac_configure_args --with-arm-kuser"
fi
AC_OUTPUT_SUBDIRS(nsprpub)
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
fi

View File

@ -178,6 +178,24 @@ js_CompareAndSwap(jsword *w, jsword ov, jsword nv)
return !_check_lock((atomic_p)w, ov, nv);
}
#elif defined(USE_ARM_KUSER)
/* See https://bugzilla.mozilla.org/show_bug.cgi?id=429387 for a
* description of this ABI; this is a function provided at a fixed
* location by the kernel in the memory space of each process.
*/
typedef int (__kernel_cmpxchg_t)(int oldval, int newval, volatile int *ptr);
#define __kernel_cmpxchg (*(__kernel_cmpxchg_t *)0xffff0fc0)
JS_STATIC_ASSERT(sizeof(jsword) == sizeof(int));
static JS_INLINE int
js_CompareAndSwap(jsword *w, jsword ov, jsword nv)
{
volatile int *vp = (volatile int*)w;
return !__kernel_cmpxchg(ov, nv, vp);
}
#else
#error "Define NSPR_LOCK if your platform lacks a compare-and-swap instruction."

View File

@ -226,7 +226,7 @@ extern void js_SetScopeInfo(JSScope *scope, const char *file, int line);
!( (defined(_WIN32) && defined(_M_IX86)) || \
(defined(__GNUC__) && defined(__i386__)) || \
(defined(SOLARIS) && defined(sparc) && defined(ULTRA_SPARC)) || \
defined(AIX) )
defined(AIX) || defined(USE_ARM_KUSER))
#define NSPR_LOCK 1