@@ -37,7 +37,8 @@ static __always_inline bool arch_static_branch(struct static_key *key, bool bran
3737 ".byte " __stringify (STATIC_KEY_INIT_NOP ) "\n\t"
3838 ".pushsection __jump_table, \"aw\" \n\t"
3939 _ASM_ALIGN "\n\t"
40- _ASM_PTR "1b, %l[l_yes], %c0 + %c1 \n\t"
40+ ".long 1b - ., %l[l_yes] - . \n\t"
41+ _ASM_PTR "%c0 + %c1 - .\n\t"
4142 ".popsection \n\t"
4243 : : "i" (key ), "i" (branch ) : : l_yes );
4344
@@ -53,7 +54,8 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key, bool
5354 "2:\n\t"
5455 ".pushsection __jump_table, \"aw\" \n\t"
5556 _ASM_ALIGN "\n\t"
56- _ASM_PTR "1b, %l[l_yes], %c0 + %c1 \n\t"
57+ ".long 1b - ., %l[l_yes] - . \n\t"
58+ _ASM_PTR "%c0 + %c1 - .\n\t"
5759 ".popsection \n\t"
5860 : : "i " (key ), "i" (branch ) : : l_yes );
5961
@@ -62,18 +64,6 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key, bool
6264 return true;
6365}
6466
65- #ifdef CONFIG_X86_64
66- typedef u64 jump_label_t ;
67- #else
68- typedef u32 jump_label_t ;
69- #endif
70-
71- struct jump_entry {
72- jump_label_t code ;
73- jump_label_t target ;
74- jump_label_t key ;
75- };
76-
7767#else /* __ASSEMBLY__ */
7868
7969.macro STATIC_JUMP_IF_TRUE target , key , def
@@ -88,7 +78,8 @@ struct jump_entry {
8878 .endif
8979 .pushsection __jump_table , "aw"
9080 _ASM_ALIGN
91- _ASM_PTR .Lstatic_jump_ \@, \target , \key
81+ .long .Lstatic_jump_ \@ - ., \target - .
82+ _ASM_PTR \key - .
9283 .popsection
9384.endm
9485
@@ -104,7 +95,8 @@ struct jump_entry {
10495 .endif
10596 .pushsection __jump_table , "aw"
10697 _ASM_ALIGN
107- _ASM_PTR .Lstatic_jump_ \@, \target , \key + 1
98+ .long .Lstatic_jump_ \@ - ., \target - .
99+ _ASM_PTR \key + 1 - .
108100 .popsection
109101.endm
110102
0 commit comments