1 #ifndef _ASM_X86_JUMP_LABEL_H
2 #define _ASM_X86_JUMP_LABEL_H
6 #include <linux/stringify.h>
7 #include <linux/types.h>
11 #define JUMP_LABEL_NOP_SIZE 5
14 # define STATIC_KEY_INIT_NOP P6_NOP5_ATOMIC
16 # define STATIC_KEY_INIT_NOP GENERIC_NOP5_ATOMIC
19 static __always_inline
bool arch_static_branch(struct static_key
*key
, bool branch
)
21 asm_volatile_goto("1:"
22 ".byte " __stringify(STATIC_KEY_INIT_NOP
) "\n\t"
23 ".pushsection __jump_table, \"aw\" \n\t"
25 _ASM_PTR
"1b, %l[l_yes], %c0 + %c1 \n\t"
27 : : "i" (key
), "i" (branch
) : : l_yes
);
34 static __always_inline
bool arch_static_branch_jump(struct static_key
*key
, bool branch
)
36 asm_volatile_goto("1:"
37 ".byte 0xe9\n\t .long %l[l_yes] - 2f\n\t"
39 ".pushsection __jump_table, \"aw\" \n\t"
41 _ASM_PTR
"1b, %l[l_yes], %c0 + %c1 \n\t"
43 : : "i" (key
), "i" (branch
) : : l_yes
);
51 typedef u64 jump_label_t
;
53 typedef u32 jump_label_t
;
62 #endif /* __ASSEMBLY__ */
This page took 0.032853 seconds and 5 git commands to generate.