Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[deliverable/linux.git] / arch / s390 / include / asm / jump_label.h
CommitLineData
5373db88
JG
1#ifndef _ASM_S390_JUMP_LABEL_H
2#define _ASM_S390_JUMP_LABEL_H
3
55dd0df7
AB
4#ifndef __ASSEMBLY__
5
5373db88
JG
6#include <linux/types.h>
7
8#define JUMP_LABEL_NOP_SIZE 6
d5caa4db 9#define JUMP_LABEL_NOP_OFFSET 2
5373db88 10
d5caa4db
HC
11/*
12 * We use a brcl 0,2 instruction for jump labels at compile time so it
13 * can be easily distinguished from a hotpatch generated instruction.
14 */
c5905afb 15static __always_inline bool arch_static_branch(struct static_key *key)
5373db88 16{
d5caa4db 17 asm_volatile_goto("0: brcl 0,"__stringify(JUMP_LABEL_NOP_OFFSET)"\n"
5373db88 18 ".pushsection __jump_table, \"aw\"\n"
5a79859a
HC
19 ".balign 8\n"
20 ".quad 0b, %l[label], %0\n"
5373db88
JG
21 ".popsection\n"
22 : : "X" (key) : : label);
23 return false;
24label:
25 return true;
26}
27
28typedef unsigned long jump_label_t;
29
30struct jump_entry {
31 jump_label_t code;
32 jump_label_t target;
33 jump_label_t key;
34};
35
55dd0df7 36#endif /* __ASSEMBLY__ */
5373db88 37#endif
This page took 0.25002 seconds and 5 git commands to generate.