summaryrefslogtreecommitdiff
path: root/include/os/freebsd/spl/sys/atomic.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/os/freebsd/spl/sys/atomic.h')
-rw-r--r--include/os/freebsd/spl/sys/atomic.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/os/freebsd/spl/sys/atomic.h b/include/os/freebsd/spl/sys/atomic.h
index 4227e5f7d3ec4..1a68bfc4de23c 100644
--- a/include/os/freebsd/spl/sys/atomic.h
+++ b/include/os/freebsd/spl/sys/atomic.h
@@ -29,6 +29,8 @@
#ifndef _OPENSOLARIS_SYS_ATOMIC_H_
#define _OPENSOLARIS_SYS_ATOMIC_H_
+#ifndef _STANDALONE
+
#include <sys/types.h>
#include <machine/atomic.h>
@@ -179,4 +181,13 @@ atomic_cas_ptr(volatile void *target, void *cmp, void *newval)
}
#endif /* !defined(COMPAT_32BIT) && defined(__LP64__) */
+#else /* _STANDALONE */
+/*
+ * sometimes atomic_add_64 is defined, sometimes not, but the
+ * following is always right for the boot loader.
+ */
+#undef atomic_add_64
+#define atomic_add_64(ptr, val) *(ptr) += val
+#endif /* !_STANDALONE */
+
#endif /* !_OPENSOLARIS_SYS_ATOMIC_H_ */