Skip to content

Commit c98a464

Browse files
fllindenpuranjaymohan
authored andcommitted
compiler.h: bring back annotate_unreachable
bfb1a7c ("x86/bug: Merge annotate_reachable() into _BUG_FLAGS() asm") removed annotate_reachable, since it's folded in to the BUG_FLAGS macro on x86 now. However, we use it on arm64, so it needs to stick around for a while longer. Signed-off-by: Frank van der Linden <[email protected]>
1 parent 1718d2a commit c98a464

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

include/linux/compiler.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
117117
*/
118118
#define __stringify_label(n) #n
119119

120+
#define __annotate_reachable(c) ({ \
121+
asm volatile(__stringify_label(c) ":\n\t" \
122+
".pushsection .discard.reachable\n\t" \
123+
".long " __stringify_label(c) "b - .\n\t" \
124+
".popsection\n\t" : : "i" (c)); \
125+
})
126+
#define annotate_reachable() __annotate_reachable(__COUNTER__)
127+
120128
#define __annotate_unreachable(c) ({ \
121129
asm volatile(__stringify_label(c) ":\n\t" \
122130
".pushsection .discard.unreachable\n\t" \
@@ -135,6 +143,7 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
135143
#define __annotate_jump_table __section(".rodata..c_jump_table")
136144

137145
#else
146+
#define annotate_reachable()
138147
#define annotate_unreachable()
139148
# define ASM_REACHABLE
140149
#define __annotate_jump_table

0 commit comments

Comments
 (0)