diff options
author | Luis R. Rodriguez <mcgrof@kernel.org> | 2016-06-29 17:20:52 -0700 |
---|---|---|
committer | Luis R. Rodriguez <mcgrof@kernel.org> | 2016-06-29 17:29:05 -0700 |
commit | 63cea6edc51ef4605c14692417392c1505cfb738 (patch) | |
tree | 122043c3dab6b9033736a229ce4e1d608d05a11e | |
parent | 81c47108597e52e1f4cd10786893ec9ba337b9c4 (diff) | |
download | linker-tables-63cea6edc51ef4605c14692417392c1505cfb738.tar.gz |
asm-generic/sections.h: extend assembler push_section_type()
Add flags support to the assembler version of push_section_type().
This also makes then SECTION_TYPE() be the assembler default if
the flags are empty. This is optional, but since we are enabling
SECTION_TYPE() to be defined for all code this lets us keep a
definition for it for C code, assembly, and assembler.
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
-rw-r--r-- | drivers/synth/or.S | 10 | ||||
-rw-r--r-- | include/asm-generic/sections.h | 7 | ||||
-rw-r--r-- | include/linux/ranges.h | 10 |
3 files changed, 14 insertions, 13 deletions
diff --git a/drivers/synth/or.S b/drivers/synth/or.S index 6628007..a355590 100644 --- a/drivers/synth/or.S +++ b/drivers/synth/or.S @@ -2,7 +2,7 @@ DECLARE_SECTION_RANGE(SECTION_TEXT, synth_init_or) - push_section_rng(SECTION_TEXT, synth_init_or, 01) + push_section_rng(SECTION_TEXT, synth_init_or, 01, ) /* err = 0; */ pushq %rbp movq %rsp,%rbp @@ -10,7 +10,7 @@ xorq %rbx,%rbx .popsection - push_section_rng(SECTION_TEXT, synth_init_or, 99) + push_section_rng(SECTION_TEXT, synth_init_or, 99, ) /* return err; */ movq %rbx,%rax popq %rbx @@ -18,21 +18,21 @@ retq .popsection - push_section_rng(SECTION_TEXT, synth_init_or, 50) + push_section_rng(SECTION_TEXT, synth_init_or, 50, ) /* err |= demo_or_1(1); */ movl $1,%edi call demo_or_1 orq %rax,%rbx .popsection - push_section_rng(SECTION_TEXT, synth_init_or, 50) + push_section_rng(SECTION_TEXT, synth_init_or, 50, ) /* err |= demo_or_1(2); */ movl $2,%edi call demo_or_1 orq %rax,%rbx .popsection - push_section_rng(SECTION_TEXT, synth_init_or, 50) + push_section_rng(SECTION_TEXT, synth_init_or, 50, ) /* err |= demo_or_2(); */ call demo_or_2 orq %rax,%rbx diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index bd0d975..7eea2bd 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h @@ -8,13 +8,14 @@ #ifdef __ASSEMBLER__ #ifndef SECTION_TYPE -#define SECTION_TYPE push_section_type +#define SECTION_TYPE(section, type, name, level) \ + push_section_type(section, type, name, level, ) #endif /* Used on foo.S for instance */ #ifndef push_section_type -#define push_section_type(section, type, name, level) \ - .pushsection section.type.name.#level +#define push_section_type(section, type, name, level, flags) \ + .pushsection section.type.name.#level, #flags #endif #else /* __ASSEMBLER__ */ diff --git a/include/linux/ranges.h b/include/linux/ranges.h index b35f1ba..3589619 100644 --- a/include/linux/ranges.h +++ b/include/linux/ranges.h @@ -9,18 +9,18 @@ SECTION_TYPE(section, SECTION_TYPE_RANGES, name, level) #ifdef __ASSEMBLER__ +#define push_section_rng(section, name, level, flags) \ + push_section_type(section, SECTION_TYPE_RANGES, name, level, flags) + #define DECLARE_SECTION_RANGE(section, name) \ - SECTION_RANGE(section, name,) ; \ + push_section_rng(section, name,,) ; \ .globl name ; \ name: ; \ .popsection \ \ - SECTION_RANGE(section, name, ~) ; \ + push_section_rng(section, name, ~,) ; \ .popsection -#define push_section_rng(section, name, level) \ - push_section_type(section, SECTION_TYPE_RANGES, name, level) - #else #ifndef __ASSEMBLY__ |