@@ -99,13 +99,22 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
99
99
* unique, to convince GCC not to merge duplicate inline asm statements.
100
100
*/
101
101
#define annotate_reachable () ({ \
102
- asm volatile("ANNOTATE_REACHABLE counter=%c0" \
103
- : : "i" (__COUNTER__)); \
102
+ asm volatile("%c0:\n\t" \
103
+ ".pushsection .discard.reachable\n\t" \
104
+ ".long %c0b - .\n\t" \
105
+ ".popsection\n\t" : : "i" (__COUNTER__)); \
104
106
})
105
107
#define annotate_unreachable () ({ \
106
- asm volatile("ANNOTATE_UNREACHABLE counter=%c0" \
107
- : : "i" (__COUNTER__)); \
108
+ asm volatile("%c0:\n\t" \
109
+ ".pushsection .discard.unreachable\n\t" \
110
+ ".long %c0b - .\n\t" \
111
+ ".popsection\n\t" : : "i" (__COUNTER__)); \
108
112
})
113
+ #define ASM_UNREACHABLE \
114
+ "999:\n\t" \
115
+ ".pushsection .discard.unreachable\n\t" \
116
+ ".long 999b - .\n\t" \
117
+ ".popsection\n\t"
109
118
#else
110
119
#define annotate_reachable ()
111
120
#define annotate_unreachable ()
@@ -293,45 +302,6 @@ static inline void *offset_to_ptr(const int *off)
293
302
return (void * )((unsigned long )off + * off );
294
303
}
295
304
296
- #else /* __ASSEMBLY__ */
297
-
298
- #ifdef __KERNEL__
299
- #ifndef LINKER_SCRIPT
300
-
301
- #ifdef CONFIG_STACK_VALIDATION
302
- .macro ANNOTATE_UNREACHABLE counter :req
303
- \counter :
304
- .pushsection .discard .unreachable
305
- .long \counter \()b - .
306
- .popsection
307
- .endm
308
-
309
- .macro ANNOTATE_REACHABLE counter :req
310
- \counter :
311
- .pushsection .discard .reachable
312
- .long \counter \()b - .
313
- .popsection
314
- .endm
315
-
316
- .macro ASM_UNREACHABLE
317
- 999 :
318
- .pushsection .discard .unreachable
319
- .long 999b - .
320
- .popsection
321
- .endm
322
- #else /* CONFIG_STACK_VALIDATION */
323
- .macro ANNOTATE_UNREACHABLE counter :req
324
- .endm
325
-
326
- .macro ANNOTATE_REACHABLE counter :req
327
- .endm
328
-
329
- .macro ASM_UNREACHABLE
330
- .endm
331
- #endif /* CONFIG_STACK_VALIDATION */
332
-
333
- #endif /* LINKER_SCRIPT */
334
- #endif /* __KERNEL__ */
335
305
#endif /* __ASSEMBLY__ */
336
306
337
307
/* Compile time object size, -1 for unknown */
0 commit comments