summaryrefslogtreecommitdiffstats
path: root/freebsd
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-10-10 10:31:04 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-10-31 13:18:45 +0100
commit7c801d1b011be6e3b0f0c80fb285bf026d048218 (patch)
treecfeea237f5c0eef1e74e68440f371543dfa44ace /freebsd
parenttestsuite: Enable stack checker (diff)
downloadrtems-libbsd-7c801d1b011be6e3b0f0c80fb285bf026d048218.tar.bz2
Fix warnings in <sys/refcount.h>
Diffstat (limited to 'freebsd')
-rw-r--r--freebsd/sys/sys/refcount.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/freebsd/sys/sys/refcount.h b/freebsd/sys/sys/refcount.h
index 848b69ca..7cf4d47b 100644
--- a/freebsd/sys/sys/refcount.h
+++ b/freebsd/sys/sys/refcount.h
@@ -51,7 +51,11 @@ static __inline void
refcount_acquire(volatile u_int *count)
{
+#ifndef __rtems__
atomic_add_acq_int(count, 1);
+#else /* __rtems__ */
+ atomic_add_acq_int((volatile int *) count, 1);
+#endif /* __rtems__ */
}
static __inline int
@@ -60,7 +64,11 @@ refcount_release(volatile u_int *count)
u_int old;
/* XXX: Should this have a rel membar? */
+#ifndef __rtems__
old = atomic_fetchadd_int(count, -1);
+#else /* __rtems__ */
+ old = atomic_fetchadd_int((volatile int *) count, -1);
+#endif /* __rtems__ */
KASSERT(old > 0, ("negative refcount %p", count));
return (old == 1);
}