projects
/
userspace-rcu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
atomic: fix typo in x86 compat implementation
[userspace-rcu.git]
/
urcu
/
uatomic_arch_x86.h
diff --git
a/urcu/uatomic_arch_x86.h
b/urcu/uatomic_arch_x86.h
index e358be3673552dd9919ca6579e2c83071410157a..09a5bbbbfa0f98fa1b7b840a06fc5e4dde5e1dbf 100644
(file)
--- a/
urcu/uatomic_arch_x86.h
+++ b/
urcu/uatomic_arch_x86.h
@@
-23,22
+23,13
@@
#include <urcu/compiler.h>
#include <urcu/system.h>
#include <urcu/compiler.h>
#include <urcu/system.h>
+#define UATOMIC_HAS_ATOMIC_BYTE
+#define UATOMIC_HAS_ATOMIC_SHORT
+
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef __SIZEOF_LONG__
-#if defined(__x86_64__) || defined(__amd64__)
-#define __SIZEOF_LONG__ 8
-#else
-#define __SIZEOF_LONG__ 4
-#endif
-#endif
-
-#ifndef BITS_PER_LONG
-#define BITS_PER_LONG (__SIZEOF_LONG__ * 8)
-#endif
-
/*
* Derived from AO_compare_and_swap() and AO_test_and_set_full().
*/
/*
* Derived from AO_compare_and_swap() and AO_test_and_set_full().
*/
@@
-48,7
+39,7
@@
struct __uatomic_dummy {
};
#define __hp(x) ((struct __uatomic_dummy *)(x))
};
#define __hp(x) ((struct __uatomic_dummy *)(x))
-#define _uatomic_set(addr, v) STORE_SHARED(*(addr), (v))
+#define _uatomic_set(addr, v)
CMM_
STORE_SHARED(*(addr), (v))
/* cmpxchg */
/* cmpxchg */
@@
-90,7
+81,7
@@
unsigned long __uatomic_cmpxchg(void *addr, unsigned long old,
: "memory");
return result;
}
: "memory");
return result;
}
-#if (BITS_PER_LONG == 64)
+#if (
CAA_
BITS_PER_LONG == 64)
case 8:
{
unsigned long result = old;
case 8:
{
unsigned long result = old;
@@
-152,7
+143,7
@@
unsigned long __uatomic_exchange(void *addr, unsigned long val, int len)
: "memory");
return result;
}
: "memory");
return result;
}
-#if (BITS_PER_LONG == 64)
+#if (
CAA_
BITS_PER_LONG == 64)
case 8:
{
unsigned long result;
case 8:
{
unsigned long result;
@@
-215,7
+206,7
@@
unsigned long __uatomic_add_return(void *addr, unsigned long val,
: "memory");
return result + (unsigned int)val;
}
: "memory");
return result + (unsigned int)val;
}
-#if (BITS_PER_LONG == 64)
+#if (
CAA_
BITS_PER_LONG == 64)
case 8:
{
unsigned long result = val;
case 8:
{
unsigned long result = val;
@@
-273,7
+264,7
@@
void __uatomic_add(void *addr, unsigned long val, int len)
: "memory");
return;
}
: "memory");
return;
}
-#if (BITS_PER_LONG == 64)
+#if (
CAA_
BITS_PER_LONG == 64)
case 8:
{
__asm__ __volatile__(
case 8:
{
__asm__ __volatile__(
@@
-328,7
+319,7
@@
void __uatomic_inc(void *addr, int len)
: "memory");
return;
}
: "memory");
return;
}
-#if (BITS_PER_LONG == 64)
+#if (
CAA_
BITS_PER_LONG == 64)
case 8:
{
__asm__ __volatile__(
case 8:
{
__asm__ __volatile__(
@@
-381,7
+372,7
@@
void __uatomic_dec(void *addr, int len)
: "memory");
return;
}
: "memory");
return;
}
-#if (BITS_PER_LONG == 64)
+#if (
CAA_
BITS_PER_LONG == 64)
case 8:
{
__asm__ __volatile__(
case 8:
{
__asm__ __volatile__(
@@
-401,7
+392,7
@@
void __uatomic_dec(void *addr, int len)
#define _uatomic_dec(addr) (__uatomic_dec((addr), sizeof(*(addr))))
#define _uatomic_dec(addr) (__uatomic_dec((addr), sizeof(*(addr))))
-#if ((BITS_PER_LONG != 64) && defined(CONFIG_RCU_COMPAT_ARCH))
+#if ((
CAA_
BITS_PER_LONG != 64) && defined(CONFIG_RCU_COMPAT_ARCH))
extern int __rcu_cas_avail;
extern int __rcu_cas_init(void);
extern int __rcu_cas_avail;
extern int __rcu_cas_init(void);
@@
-437,8
+428,8
@@
extern unsigned long _compat_uatomic_cmpxchg(void *addr, unsigned long old,
(unsigned long)(_new), \
sizeof(*(addr))))
(unsigned long)(_new), \
sizeof(*(addr))))
-extern unsigned long _compat_uatomic_
xchg
(void *addr,
- unsigned long _new, int len);
+extern unsigned long _compat_uatomic_
add_return
(void *addr,
+
unsigned long _new, int len);
#define compat_uatomic_add_return(addr, v) \
((__typeof__(*(addr))) _compat_uatomic_add_return((addr), \
(unsigned long)(v), \
#define compat_uatomic_add_return(addr, v) \
((__typeof__(*(addr))) _compat_uatomic_add_return((addr), \
(unsigned long)(v), \
This page took
0.02558 seconds
and
4
git commands to generate.