aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@kernel.org>2016-06-29 12:24:43 -0700
committerLuis R. Rodriguez <mcgrof@kernel.org>2016-06-29 17:29:05 -0700
commit65b85f7b419b16416a53d94b9b3cd1c3e895341c (patch)
treef62043f68977a8c31cea8e1cea65381a27df6f86
parentc16aefb49f4e6281eae247c162d59e7f557069a5 (diff)
downloadlinker-tables-65b85f7b419b16416a53d94b9b3cd1c3e895341c.tar.gz
asm-generic: add push_section_type() to be used on asm volatile() code
With generic section type solutions in place we need a general asm solution for declaring entries with asm. The first easy target is to cover the C asm declarations, guard the header file for now with __ASSEMBLY__ and define a first generic entry push_section_type() to be used later for custom section type annotations. Architectures can override. As suggested by hpa and later confirmed by Heiko for the extreme corner case concern on s390, just \n should work across the board [0]. [0] https://lkml.kernel.org/r/20160226145603.GA3964@osiris Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
-rw-r--r--arch/x86/include/asm/sections.h6
-rw-r--r--include/asm-generic/sections.h19
-rw-r--r--include/linux/sections.h2
3 files changed, 27 insertions, 0 deletions
diff --git a/arch/x86/include/asm/sections.h b/arch/x86/include/asm/sections.h
new file mode 100644
index 0000000..a163c3d
--- /dev/null
+++ b/arch/x86/include/asm/sections.h
@@ -0,0 +1,6 @@
+#ifndef _ASM_X86_SECTIONS_H
+#define _ASM_X86_SECTIONS_H
+
+#include <asm-generic/sections.h>
+
+#endif /* _ASM_X86_SECTIONS_H */
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
new file mode 100644
index 0000000..4b042db
--- /dev/null
+++ b/include/asm-generic/sections.h
@@ -0,0 +1,19 @@
+#ifndef _ASM_GENERIC_SECTIONS_H_
+#define _ASM_GENERIC_SECTIONS_H_
+
+#ifndef __ASSEMBLY__
+#include <linux/sections.h>
+
+#ifndef __push_section_type
+#define __push_section_type(section, type, name, level, flags) \
+ ".pushsection " #section "." #type "." #name "." #level ", \"" #flags "\"\n"
+#endif
+
+#ifndef push_section_type
+#define push_section_type(section, type, name, level, flags) \
+ __push_section_type(section, type, name, level)
+#endif
+
+#endif
+
+#endif /* _ASM_GENERIC_SECTIONS_H_ */
diff --git a/include/linux/sections.h b/include/linux/sections.h
index f738844..36af3fa 100644
--- a/include/linux/sections.h
+++ b/include/linux/sections.h
@@ -1,6 +1,8 @@
#ifndef _LINUX_SECTIONS_H
#define _LINUX_SECTIONS_H
+#include <asm/sections.h>
+
#define SECTION_RODATA .rodata
#define SECTION_TEXT .text
#define SECTION_DATA .data