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
13 #include <linux/types.h>
15 #define JUMP_LABEL_NOP_SIZE 4
18 #define WORD_INSN ".dword"
20 #define WORD_INSN ".word"
23 #ifdef CONFIG_CPU_MICROMIPS
29 static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
31 asm_volatile_goto("1:\t" B_INSN " 2f\n\t"
33 ".pushsection __jump_table, \"aw\"\n\t"
34 WORD_INSN " 1b, %l[l_yes], %0\n\t"
36 : : "i" (&((char *)key)[branch]) : : l_yes);
43 static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch)
45 asm_volatile_goto("1:\tj %l[l_yes]\n\t"
47 ".pushsection __jump_table, \"aw\"\n\t"
48 WORD_INSN " 1b, %l[l_yes], %0\n\t"
50 : : "i" (&((char *)key)[branch]) : : l_yes);
58 typedef u64 jump_label_t;
60 typedef u32 jump_label_t;
69 #endif /* __ASSEMBLY__ */
70 #endif /* _ASM_MIPS_JUMP_LABEL_H */