[sysprof] util: add full memory barrier fallback
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof] util: add full memory barrier fallback
- Date: Tue, 23 Aug 2016 17:08:49 +0000 (UTC)
commit 1c1ef02b3dfb227b0b9065e6df5fe483a17bf622
Author: Christian Hergert <chergert redhat com>
Date: Tue Aug 23 10:08:37 2016 -0700
util: add full memory barrier fallback
lib/util/util.h | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/lib/util/util.h b/lib/util/util.h
index 6062d43..7c19c32 100644
--- a/lib/util/util.h
+++ b/lib/util/util.h
@@ -33,4 +33,12 @@
#define read_barrier() asm volatile("dsb" ::: "memory")
#endif
+/*
+ * Fallback to a full memory barrier if the architecture is not yet
+ * supported with a lighter read barrier.
+ */
+#ifndef read_barrier
+#define read_barrier() __sync_synchronize()
+#endif
+
#endif /* SP_UTIL_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]