[PATCH 03/16] header: add barrier_data()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



barrier_data() was added in Linux commit 7829fb09 "lib: make
memzero_explicit more robust against dead store elimination".
This is needed by memzero_explicit added in the next patch.

Signed-off-by: Hauke Mehrtens <hauke@xxxxxxxxxx>
---
 backport/backport-include/linux/compiler.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/backport/backport-include/linux/compiler.h b/backport/backport-include/linux/compiler.h
index 613b857..0b2358c 100644
--- a/backport/backport-include/linux/compiler.h
+++ b/backport/backport-include/linux/compiler.h
@@ -25,4 +25,12 @@
 # define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __LINE__)
 #endif
 
+#ifndef barrier_data
+#ifdef __GNUC__
+#define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory")
+#else /* __GNUC__ */
+# define barrier_data(ptr) barrier()
+#endif /* __GNUC__ */
+#endif
+
 #endif /* __BACKPORT_LINUX_COMPILER_H */
-- 
2.8.1

--
To unsubscribe from this list: send the line "unsubscribe backports" in



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux