svn commit: r213822 - projects/ofed/head/sys/ofed/include/asm
Jeff Roberson
jeff at FreeBSD.org
Thu Oct 14 01:48:52 UTC 2010
Author: jeff
Date: Thu Oct 14 01:48:51 2010
New Revision: 213822
URL: http://svn.freebsd.org/changeset/base/213822
Log:
- Correct sign of return values from atomic functions. This was preventing
atomic_add_negative() from detecting negative values.
Sponsored by: Isilon Systems, iX Systems, and Panasas.
Modified:
projects/ofed/head/sys/ofed/include/asm/atomic-long.h
projects/ofed/head/sys/ofed/include/asm/atomic.h
Modified: projects/ofed/head/sys/ofed/include/asm/atomic-long.h
==============================================================================
--- projects/ofed/head/sys/ofed/include/asm/atomic-long.h Thu Oct 14 01:47:47 2010 (r213821)
+++ projects/ofed/head/sys/ofed/include/asm/atomic-long.h Thu Oct 14 01:48:51 2010 (r213822)
@@ -39,7 +39,7 @@ typedef struct {
#define atomic_long_add(i, v) atomic_long_add_return((i), (v))
#define atomic_long_inc_return(v) atomic_long_add_return(1, (v))
-static inline u_long
+static inline long
atomic_long_add_return(long i, atomic_long_t *v)
{
return i + atomic_fetchadd_long(&v->counter, i);
Modified: projects/ofed/head/sys/ofed/include/asm/atomic.h
==============================================================================
--- projects/ofed/head/sys/ofed/include/asm/atomic.h Thu Oct 14 01:47:47 2010 (r213821)
+++ projects/ofed/head/sys/ofed/include/asm/atomic.h Thu Oct 14 01:48:51 2010 (r213822)
@@ -46,13 +46,13 @@ typedef struct {
#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0)
#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0)
-static inline u_int
+static inline int
atomic_add_return(int i, atomic_t *v)
{
return i + atomic_fetchadd_int(&v->counter, i);
}
-static inline u_int
+static inline int
atomic_sub_return(int i, atomic_t *v)
{
return atomic_fetchadd_int(&v->counter, -i) - i;
More information about the svn-src-projects
mailing list