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>
18 #define JUMP_LABEL_NOP_SIZE 4
21 #define WORD_INSN ".dword"
23 #define WORD_INSN ".word"
26 #ifdef CONFIG_CPU_MICROMIPS
29 #elif MIPS_ISA_REV >= 6
37 static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
39 asm_volatile_goto("1:\t" B_INSN " 2f\n\t"
41 ".pushsection __jump_table, \"aw\"\n\t"
42 WORD_INSN " 1b, %l[l_yes], %0\n\t"
44 : : "i" (&((char *)key)[branch]) : : l_yes);
51 static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)
53 asm_volatile_goto("1:\t" J_INSN " %l[l_yes]\n\t"
54 ".pushsection __jump_table, \"aw\"\n\t"
55 WORD_INSN " 1b, %l[l_yes], %0\n\t"
57 : : "i" (&((char *)key)[branch]) : : l_yes);
65 typedef u64 jump_label_t;
67 typedef u32 jump_label_t;
76 #endif /* __ASSEMBLY__ */
77 #endif /* _ASM_MIPS_JUMP_LABEL_H */