Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/crypto/external/bsd/heimdal Use <sys/atomic.h> ops on NetBSD...
details: https://anonhg.NetBSD.org/src/rev/af5018892abd
branches: trunk
changeset: 764328:af5018892abd
user: martin <martin%NetBSD.org@localhost>
date: Sat Apr 16 17:45:44 2011 +0000
description:
Use <sys/atomic.h> ops on NetBSD (instead of MD gcc-isms). Stopgap fix
to unbreak the build on some risc platforms.
OK: elric
diffstat:
crypto/external/bsd/heimdal/dist/base/baselocl.h | 14 ++++++++++++--
crypto/external/bsd/heimdal/include/config.h | 9 ++++++++-
2 files changed, 20 insertions(+), 3 deletions(-)
diffs (48 lines):
diff -r 53242a7abddd -r af5018892abd crypto/external/bsd/heimdal/dist/base/baselocl.h
--- a/crypto/external/bsd/heimdal/dist/base/baselocl.h Sat Apr 16 17:16:12 2011 +0000
+++ b/crypto/external/bsd/heimdal/dist/base/baselocl.h Sat Apr 16 17:45:44 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: baselocl.h,v 1.1.1.1 2011/04/13 18:14:32 elric Exp $ */
+/* $NetBSD: baselocl.h,v 1.2 2011/04/16 17:45:44 martin Exp $ */
/*
* Copyright (c) 2010 Kungliga Tekniska Högskolan
@@ -56,7 +56,17 @@
#include <dispatch/dispatch.h>
#endif
-#if defined(__GNUC__) && defined(HAVE___SYNC_ADD_AND_FETCH)
+#if defined(USE_ATOMIC_INCDEC)
+
+#include <sys/atomic.h>
+#define heim_base_atomic_inc(x) atomic_inc_32_nv((x))
+#define heim_base_atomic_dec(x) atomic_dec_32_nv((x))
+#define heim_base_atomic_type uint32_t
+#define heim_base_atomic_max UINT32_MAX
+
+#define heim_base_exchange_pointer(t,v) atomic_swap_ptr((t), (v))
+
+#elif defined(__GNUC__) && defined(HAVE___SYNC_ADD_AND_FETCH)
#define heim_base_atomic_inc(x) __sync_add_and_fetch((x), 1)
#define heim_base_atomic_dec(x) __sync_sub_and_fetch((x), 1)
diff -r 53242a7abddd -r af5018892abd crypto/external/bsd/heimdal/include/config.h
--- a/crypto/external/bsd/heimdal/include/config.h Sat Apr 16 17:16:12 2011 +0000
+++ b/crypto/external/bsd/heimdal/include/config.h Sat Apr 16 17:45:44 2011 +0000
@@ -1276,8 +1276,15 @@
/* Define if you have the `__progname' variable. */
#define HAVE___PROGNAME 1
+/*
+ * Not all NetBSD platforms have __sync_add_and_fetch, but NetBSD provides
+ * the standard <sys/atomic.h> API everywhere.
+ */
+#define USE_ATOMIC_INCDEC 1
/* have __sync_add_and_fetch */
-#define HAVE___SYNC_ADD_AND_FETCH 1
+/*
+ * #define HAVE___SYNC_ADD_AND_FETCH 1
+ */
/* Define if you want support for weak crypto */
#define HEIM_WEAK_CRYPTO 1
Home |
Main Index |
Thread Index |
Old Index