Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/cddl/osnet/lib/libzpool Add fake atomic 64 ops for ...
details: https://anonhg.NetBSD.org/src/rev/f4ee138b094c
branches: trunk
changeset: 328884:f4ee138b094c
user: christos <christos%NetBSD.org@localhost>
date: Tue Apr 22 15:02:38 2014 +0000
description:
Add fake atomic 64 ops for those who don't have them.
XXX: used to be arm, now it is also i386.
diffstat:
external/cddl/osnet/lib/libzpool/Makefile | 7 ++-----
external/cddl/osnet/lib/libzpool/atomic.c | 5 +++++
2 files changed, 7 insertions(+), 5 deletions(-)
diffs (41 lines):
diff -r 358f56120fe8 -r f4ee138b094c external/cddl/osnet/lib/libzpool/Makefile
--- a/external/cddl/osnet/lib/libzpool/Makefile Tue Apr 22 14:20:03 2014 +0000
+++ b/external/cddl/osnet/lib/libzpool/Makefile Tue Apr 22 15:02:38 2014 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2013/09/11 23:04:10 joerg Exp $
+# $NetBSD: Makefile,v 1.9 2014/04/22 15:02:38 christos Exp $
.include "${.CURDIR}/../../dist/uts/common/Makefile.files"
.include "../../Makefile.zfs"
@@ -21,10 +21,7 @@
#CPPFLAGS+=-Wall -Wno-unknown-pragmas
# Local stuff
-SRCS= kernel.c kernel2.c
-.if ${MACHINE_ARCH} == "arm"
-SRCS+= atomic.c
-.endif
+SRCS= kernel.c kernel2.c atomic.c
# Sun stuff
SRCS+= ${ZFS_COMMON_OBJS:C/.o$/.c/}
diff -r 358f56120fe8 -r f4ee138b094c external/cddl/osnet/lib/libzpool/atomic.c
--- a/external/cddl/osnet/lib/libzpool/atomic.c Tue Apr 22 14:20:03 2014 +0000
+++ b/external/cddl/osnet/lib/libzpool/atomic.c Tue Apr 22 15:02:38 2014 +0000
@@ -1,7 +1,10 @@
#include <inttypes.h>
+#include <sys/types.h>
#include <sys/atomic.h>
+#ifndef __HAVE_ATOMIC64_OPS
+
/* XXX: Not so atomic, could use mutexes but not worth it */
uint64_t
atomic_cas_64(volatile uint64_t *ptr, uint64_t old, uint64_t new) {
@@ -30,3 +33,5 @@
atomic_add_64_nv(volatile uint64_t *ptr, int64_t delta) {
return *ptr += delta;
}
+
+#endif
Home |
Main Index |
Thread Index |
Old Index