| .. | .. |
|---|
| 11 | 11 | #ifndef __ASSEMBLY__ |
|---|
| 12 | 12 | |
|---|
| 13 | 13 | #include <linux/types.h> |
|---|
| 14 | +#include <asm/isa-rev.h> |
|---|
| 14 | 15 | |
|---|
| 15 | 16 | #define JUMP_LABEL_NOP_SIZE 4 |
|---|
| 16 | 17 | |
|---|
| .. | .. |
|---|
| 21 | 22 | #endif |
|---|
| 22 | 23 | |
|---|
| 23 | 24 | #ifdef CONFIG_CPU_MICROMIPS |
|---|
| 24 | | -#define B_INSN "b32" |
|---|
| 25 | +# define B_INSN "b32" |
|---|
| 26 | +# define J_INSN "j32" |
|---|
| 27 | +#elif MIPS_ISA_REV >= 6 |
|---|
| 28 | +# define B_INSN "bc" |
|---|
| 29 | +# define J_INSN "bc" |
|---|
| 25 | 30 | #else |
|---|
| 26 | | -#define B_INSN "b" |
|---|
| 31 | +# define B_INSN "b" |
|---|
| 32 | +# define J_INSN "j" |
|---|
| 27 | 33 | #endif |
|---|
| 28 | 34 | |
|---|
| 29 | 35 | static __always_inline bool arch_static_branch(struct static_key *key, bool branch) |
|---|
| 30 | 36 | { |
|---|
| 31 | 37 | asm_volatile_goto("1:\t" B_INSN " 2f\n\t" |
|---|
| 32 | | - "2:\tnop\n\t" |
|---|
| 38 | + "2:\t.insn\n\t" |
|---|
| 33 | 39 | ".pushsection __jump_table, \"aw\"\n\t" |
|---|
| 34 | 40 | WORD_INSN " 1b, %l[l_yes], %0\n\t" |
|---|
| 35 | 41 | ".popsection\n\t" |
|---|
| .. | .. |
|---|
| 42 | 48 | |
|---|
| 43 | 49 | static __always_inline bool arch_static_branch_jump(struct static_key *key, bool branch) |
|---|
| 44 | 50 | { |
|---|
| 45 | | - asm_volatile_goto("1:\tj %l[l_yes]\n\t" |
|---|
| 46 | | - "nop\n\t" |
|---|
| 51 | + asm_volatile_goto("1:\t" J_INSN " %l[l_yes]\n\t" |
|---|
| 47 | 52 | ".pushsection __jump_table, \"aw\"\n\t" |
|---|
| 48 | 53 | WORD_INSN " 1b, %l[l_yes], %0\n\t" |
|---|
| 49 | 54 | ".popsection\n\t" |
|---|