diff options
Diffstat (limited to 'include/linux/compiler.h')
-rw-r--r-- | include/linux/compiler.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 668569844d37..f1bfa15b6f9b 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -182,6 +182,29 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
182 | # define unreachable() do { } while (1) | 182 | # define unreachable() do { } while (1) |
183 | #endif | 183 | #endif |
184 | 184 | ||
185 | /* | ||
186 | * KENTRY - kernel entry point | ||
187 | * This can be used to annotate symbols (functions or data) that are used | ||
188 | * without their linker symbol being referenced explicitly. For example, | ||
189 | * interrupt vector handlers, or functions in the kernel image that are found | ||
190 | * programatically. | ||
191 | * | ||
192 | * Not required for symbols exported with EXPORT_SYMBOL, or initcalls. Those | ||
193 | * are handled in their own way (with KEEP() in linker scripts). | ||
194 | * | ||
195 | * KENTRY can be avoided if the symbols in question are marked as KEEP() in the | ||
196 | * linker script. For example an architecture could KEEP() its entire | ||
197 | * boot/exception vector code rather than annotate each function and data. | ||
198 | */ | ||
199 | #ifndef KENTRY | ||
200 | # define KENTRY(sym) \ | ||
201 | extern typeof(sym) sym; \ | ||
202 | static const unsigned long __kentry_##sym \ | ||
203 | __used \ | ||
204 | __attribute__((section("___kentry" "+" #sym ), used)) \ | ||
205 | = (unsigned long)&sym; | ||
206 | #endif | ||
207 | |||
185 | #ifndef RELOC_HIDE | 208 | #ifndef RELOC_HIDE |
186 | # define RELOC_HIDE(ptr, off) \ | 209 | # define RELOC_HIDE(ptr, off) \ |
187 | ({ unsigned long __ptr; \ | 210 | ({ unsigned long __ptr; \ |