cvs: pecl /apc apc_futex.c apc_futex.h config.m4 /apc/arch atomic.h /apc/arch/i386 atomic.h /apc/arch/x86_64 atomic.h

From: Date: Fri, 29 Sep 2006 07:13:01 +0000
Subject: cvs: pecl /apc apc_futex.c apc_futex.h config.m4 /apc/arch atomic.h /apc/arch/i386 atomic.h /apc/arch/x86_64 atomic.h
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-6424@lists.php.net to get a copy of this message
shire Fri Sep 29 07:13:01 2006 UTC Added files: /pecl/apc apc_futex.c apc_futex.h /pecl/apc/arch atomic.h /pecl/apc/arch/i386 atomic.h /pecl/apc/arch/x86_64 atomic.h Modified files: /pecl/apc config.m4 Log: Really adding the arch and futex files this time, left out of previous commit. Also adding EXPERIMENTAL note on --enable-apc-futex description. http://cvs.php.net/viewvc.cgi/pecl/apc/config.m4?r1=3.16&r2=3.17&diff_format=u Index: pecl/apc/config.m4 diff -u pecl/apc/config.m4:3.16 pecl/apc/config.m4:3.17 --- pecl/apc/config.m4:3.16 Thu Sep 28 21:22:09 2006 +++ pecl/apc/config.m4 Fri Sep 29 07:13:01 2006 @@ -1,5 +1,5 @@ dnl -dnl $Id: config.m4,v 3.16 2006/09/28 21:22:09 shire Exp $ +dnl $Id: config.m4,v 3.17 2006/09/29 07:13:01 shire Exp $ dnl AC_MSG_CHECKING(whether apc needs to get compiler flags from apxs) @@ -70,7 +70,7 @@ AC_MSG_CHECKING(Checking whether we should use futex locking) AC_ARG_ENABLE(apc-futex, [ --enable-apc-futex - Enable linux futex based locks ], + Enable linux futex based locks EXPERIMENTAL ], [ PHP_APC_FUTEX=$enableval AC_MSG_RESULT($enableval) http://cvs.php.net/viewvc.cgi/pecl/apc/apc_futex.c?view=markup&rev=1.1 Index: pecl/apc/apc_futex.c +++ pecl/apc/apc_futex.c http://cvs.php.net/viewvc.cgi/pecl/apc/apc_futex.h?view=markup&rev=1.1 Index: pecl/apc/apc_futex.h +++ pecl/apc/apc_futex.h http://cvs.php.net/viewvc.cgi/pecl/apc/arch/atomic.h?view=markup&rev=1.1 Index: pecl/apc/arch/atomic.h +++ pecl/apc/arch/atomic.h /* +----------------------------------------------------------------------+ | APC | +----------------------------------------------------------------------+ | Copyright (c) 2006 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Brian Shire <shire@php.net> | +----------------------------------------------------------------------+ */ /* $Id: atomic.h,v 1.1 2006/09/29 07:13:01 shire Exp $ */ #ifndef APC_ARCH_ATOMIC_H #define APC_ARCH_ATOMIC_H #if defined __x86_64__ #include "x86_64/atomic.h" #elif defined __i386__ #include "i386/atomic.h" #else #error "Unknown or Unsupported Architecture. If you would like futex suupport for your architecture, please file a request at http://pecl.php.net/bugs/report.php?package=APC" #endif #endif http://cvs.php.net/viewvc.cgi/pecl/apc/arch/i386/atomic.h?view=markup&rev=1.1 Index: pecl/apc/arch/i386/atomic.h +++ pecl/apc/arch/i386/atomic.h /* +----------------------------------------------------------------------+ | APC | +----------------------------------------------------------------------+ | Copyright (c) 2006 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Brian Shire <shire@php.net> | +----------------------------------------------------------------------+ */ /* $Id: atomic.h,v 1.1 2006/09/29 07:13:01 shire Exp $ */ #include <sys/syscall.h> #include <sys/time.h> #include <linux/futex.h> /* int sys_futex (void *futex, int op, int val, const struct timespec *timeout); */ static inline long int apc_sys_futex(void *futex, int op, int val, const struct timespec *timeout) { long int ret; /* i386 system calls are performed with nt 80h operation. * the argument order is a, b, c, d, S, D */ asm volatile ("int $0x80" : "=a" (ret) : "0" (SYS_futex), "b" (futex), "c" (op), "d" (val), "S" (timeout) : "memory" ); return ret; } static inline int apc_cmpxchg(volatile int *ptr, int old, int new) { int prev; asm volatile ("LOCK cmpxchgl %1, %2" : "=a" (prev) : "r" (new), "m" (*(ptr)), "0"(old) : "memory", "cc" ); return prev; } static inline int apc_xchg(volatile int *ptr, int new) { int ret; asm volatile ("LOCK xchgl %[new], %[ptr]" : "=a" (ret) : [new] "0" (new), [ptr] "m" (*(ptr)) : "memory" ); return ret; } http://cvs.php.net/viewvc.cgi/pecl/apc/arch/x86_64/atomic.h?view=markup&rev=1.1 Index: pecl/apc/arch/x86_64/atomic.h +++ pecl/apc/arch/x86_64/atomic.h /* +----------------------------------------------------------------------+ | APC | +----------------------------------------------------------------------+ | Copyright (c) 2006 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | | available through the world-wide-web at the following url: | | http://www.php.net/license/3_01.txt | | If you did not receive a copy of the PHP license and are unable to | | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Authors: Brian Shire <shire@php.net> | +----------------------------------------------------------------------+ */ /* $Id: atomic.h,v 1.1 2006/09/29 07:13:01 shire Exp $ */ #include <sys/syscall.h> #include <sys/time.h> #include <linux/futex.h> /* int sys_futex (void *futex, int op, int val, const struct timespec *timeout); */ static inline long int apc_sys_futex(void *futex, int op, int val, const struct timespec *timeout) { long int ret; /* x86_64 system calls are performed with the faster SYSCALL operation. * the argument order is D, S, d, c, b, a rather than * a, b, c, d, S, D as on the i386 int 80h call. */ asm volatile ("syscall" : "=a" (ret) : "0" (SYS_futex), "D" (futex), "S" (op), "d" (val), "c" (timeout) : "r11", "rcx", "memory" ); return ret; } static inline int apc_cmpxchg(volatile int *ptr, int old, int new) { int prev; asm volatile ("LOCK cmpxchgl %1, %2" : "=a" (prev) : "r" (new), "m" (*(ptr)), "0"(old) : "memory", "cc" ); return prev; } static inline int apc_xchg(volatile int *ptr, int new) { int ret; asm volatile ("LOCK xchgl %[new], %[ptr]" : "=a" (ret) : [new] "0" (new), [ptr] "m" (*(ptr)) : "memory" ); return ret; }

« previous php.pecl.cvs (#6424) next »