f60ebad
From 47bcc5136fe4e9f5bcc352395a723a8e4ac1aef7 Mon Sep 17 00:00:00 2001
f60ebad
From: Peter Robinson <pbrobinson@gmail.com>
f60ebad
Date: Wed, 3 Feb 2016 09:08:39 +0000
f60ebad
Subject: [PATCH] Copy gcc5 over to compiler-gcc6.h as a beginning of support
f60ebad
f60ebad
Add initial support for gcc6 by taking a copy of compiler-gcc5.h
f60ebad
f60ebad
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
f60ebad
---
f60ebad
 include/linux/compiler-gcc6.h | 65 +++++++++++++++++++++++++++++++++++++++++++
f60ebad
 1 file changed, 65 insertions(+)
f60ebad
 create mode 100644 include/linux/compiler-gcc6.h
f60ebad
f60ebad
diff --git a/include/linux/compiler-gcc6.h b/include/linux/compiler-gcc6.h
f60ebad
new file mode 100644
f60ebad
index 0000000..622117b
f60ebad
--- /dev/null
f60ebad
+++ b/include/linux/compiler-gcc6.h
f60ebad
@@ -0,0 +1,65 @@
f60ebad
+#ifndef __LINUX_COMPILER_H
f60ebad
+#error "Please don't include <linux/compiler-gcc6.h> directly, include <linux/compiler.h> instead."
f60ebad
+#endif
f60ebad
+
f60ebad
+#define __used				__attribute__((__used__))
f60ebad
+#define __must_check			__attribute__((warn_unused_result))
f60ebad
+#define __compiler_offsetof(a, b)	__builtin_offsetof(a, b)
f60ebad
+
f60ebad
+/* Mark functions as cold. gcc will assume any path leading to a call
f60ebad
+   to them will be unlikely.  This means a lot of manual unlikely()s
f60ebad
+   are unnecessary now for any paths leading to the usual suspects
f60ebad
+   like BUG(), printk(), panic() etc. [but let's keep them for now for
f60ebad
+   older compilers]
f60ebad
+
f60ebad
+   Early snapshots of gcc 4.3 don't support this and we can't detect this
f60ebad
+   in the preprocessor, but we can live with this because they're unreleased.
f60ebad
+   Maketime probing would be overkill here.
f60ebad
+
f60ebad
+   gcc also has a __attribute__((__hot__)) to move hot functions into
f60ebad
+   a special section, but I don't see any sense in this right now in
f60ebad
+   the kernel context */
f60ebad
+#define __cold			__attribute__((__cold__))
f60ebad
+
f60ebad
+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
f60ebad
+
f60ebad
+#ifndef __CHECKER__
f60ebad
+# define __compiletime_warning(message) __attribute__((warning(message)))
f60ebad
+# define __compiletime_error(message) __attribute__((error(message)))
f60ebad
+#endif /* __CHECKER__ */
f60ebad
+
f60ebad
+/*
f60ebad
+ * Mark a position in code as unreachable.  This can be used to
f60ebad
+ * suppress control flow warnings after asm blocks that transfer
f60ebad
+ * control elsewhere.
f60ebad
+ *
f60ebad
+ * Early snapshots of gcc 4.5 don't support this and we can't detect
f60ebad
+ * this in the preprocessor, but we can live with this because they're
f60ebad
+ * unreleased.  Really, we need to have autoconf for the kernel.
f60ebad
+ */
f60ebad
+#define unreachable() __builtin_unreachable()
f60ebad
+
f60ebad
+/* Mark a function definition as prohibited from being cloned. */
f60ebad
+#define __noclone	__attribute__((__noclone__))
f60ebad
+
f60ebad
+/*
f60ebad
+ * Tell the optimizer that something else uses this function or variable.
f60ebad
+ */
f60ebad
+#define __visible __attribute__((externally_visible))
f60ebad
+
f60ebad
+/*
f60ebad
+ * GCC 'asm goto' miscompiles certain code sequences:
f60ebad
+ *
f60ebad
+ *   http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670
f60ebad
+ *
f60ebad
+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek.
f60ebad
+ *
f60ebad
+ * (asm goto is automatically volatile - the naming reflects this.)
f60ebad
+ */
f60ebad
+#define asm_volatile_goto(x...)	do { asm goto(x); asm (""); } while (0)
f60ebad
+
f60ebad
+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
f60ebad
+#define __HAVE_BUILTIN_BSWAP32__
f60ebad
+#define __HAVE_BUILTIN_BSWAP64__
f60ebad
+#define __HAVE_BUILTIN_BSWAP16__
f60ebad
+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
f60ebad
-- 
f60ebad
2.5.0
f60ebad