1 #ifndef _ASM_S390_JUMP_LABEL_H
2 #define _ASM_S390_JUMP_LABEL_H
6 #include <linux/types.h>
7 #include <linux/stringify.h>
9 #define JUMP_LABEL_NOP_SIZE 6
10 #define JUMP_LABEL_NOP_OFFSET 2
13 * We use a brcl 0,2 instruction for jump labels at compile time so it
14 * can be easily distinguished from a hotpatch generated instruction.
16 static __always_inline
bool arch_static_branch(struct static_key
*key
, bool branch
)
18 asm_volatile_goto("0: brcl 0,"__stringify(JUMP_LABEL_NOP_OFFSET
)"\n"
19 ".pushsection __jump_table, \"aw\"\n"
21 ".quad 0b, %l[label], %0\n"
23 : : "X" (&((char *)key
)[branch
]) : : label
);
30 static __always_inline
bool arch_static_branch_jump(struct static_key
*key
, bool branch
)
32 asm_volatile_goto("0: brcl 15, %l[label]\n"
33 ".pushsection __jump_table, \"aw\"\n"
35 ".quad 0b, %l[label], %0\n"
37 : : "X" (&((char *)key
)[branch
]) : : label
);
44 typedef unsigned long jump_label_t
;
52 #endif /* __ASSEMBLY__ */