2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (c) 2010 Cavium Networks, Inc.
8 #ifndef _ASM_MIPS_JUMP_LABEL_H
9 #define _ASM_MIPS_JUMP_LABEL_H
11 #define arch_jump_label_transform_static arch_jump_label_transform
15 #include <linux/types.h>
16 #include <asm/isa-rev.h>
19 extern void jump_label_apply_nops(struct module
*mod
);
21 #define JUMP_LABEL_NOP_SIZE 4
24 #define WORD_INSN ".dword"
26 #define WORD_INSN ".word"
29 #ifdef CONFIG_CPU_MICROMIPS
32 #elif MIPS_ISA_REV >= 6
40 static __always_inline
bool arch_static_branch(struct static_key
*key
, bool branch
)
42 asm goto("1:\t" B_INSN
" 2f\n\t"
44 ".pushsection __jump_table, \"aw\"\n\t"
45 WORD_INSN
" 1b, %l[l_yes], %0\n\t"
47 : : "i" (&((char *)key
)[branch
]) : : l_yes
);
54 static __always_inline
bool arch_static_branch_jump(struct static_key
*key
, bool branch
)
56 asm goto("1:\t" J_INSN
" %l[l_yes]\n\t"
57 ".pushsection __jump_table, \"aw\"\n\t"
58 WORD_INSN
" 1b, %l[l_yes], %0\n\t"
60 : : "i" (&((char *)key
)[branch
]) : : l_yes
);
68 typedef u64 jump_label_t
;
70 typedef u32 jump_label_t
;
79 #endif /* __ASSEMBLY__ */
80 #endif /* _ASM_MIPS_JUMP_LABEL_H */