X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=php5-apc.git;a=blobdiff_plain;f=arch%2Fx86_64%2Fatomic.h;fp=arch%2Fx86_64%2Fatomic.h;h=0000000000000000000000000000000000000000;hp=4b882d5a2e6966e28978dab6fb5b19f27ee3a588;hb=a34ea625346aecd2d2b227b8ca4f114eaa607213;hpb=b0895ef8074c6dd090f9b0a65d58179941541756 diff --git a/arch/x86_64/atomic.h b/arch/x86_64/atomic.h deleted file mode 100644 index 4b882d5..0000000 --- a/arch/x86_64/atomic.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - +----------------------------------------------------------------------+ - | 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 | - +----------------------------------------------------------------------+ - - */ - -/* $Id: atomic.h,v 1.1 2006/09/29 07:13:01 shire Exp $ */ - - -#include -#include -#include - -/* 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; - -} -