projects/linux·blob master · refs

21 lines · 447 B

1// SPDX-License-Identifier: GPL-2.0
2/* Function the compiler may split into a hot part and a foo.cold part. */
3
4static const char __modinfo[]
5 __attribute__((section(".modinfo"), used, aligned(1))) = "\0name=vmlinux";
6
7static void __attribute__((cold, noinline)) slow_path(int x)
8{
9 __asm__ volatile("" :: "r"(x));
10}
11
12int target(int x)
13{
14 if (__builtin_expect(x < 0, 0))
15 slow_path(x);
16#ifdef PATCHED
17 return x + 2;
18#else
19 return x + 1;
20#endif
21}