Lines Matching refs:opcode

36 bool __kprobes simulate_jal(u32 opcode, unsigned long addr, struct pt_regs *regs)  in simulate_jal()  argument
45 u32 index = (opcode >> 7) & 0x1f; in simulate_jal()
51 imm = ((opcode >> 21) & 0x3ff) << 1; in simulate_jal()
52 imm |= ((opcode >> 20) & 0x1) << 11; in simulate_jal()
53 imm |= ((opcode >> 12) & 0xff) << 12; in simulate_jal()
54 imm |= ((opcode >> 31) & 0x1) << 20; in simulate_jal()
61 bool __kprobes simulate_jalr(u32 opcode, unsigned long addr, struct pt_regs *regs) in simulate_jalr() argument
70 u32 imm = (opcode >> 20) & 0xfff; in simulate_jalr()
71 u32 rd_index = (opcode >> 7) & 0x1f; in simulate_jalr()
72 u32 rs1_index = (opcode >> 15) & 0x1f; in simulate_jalr()
87 #define auipc_rd_idx(opcode) \ argument
88 ((opcode >> 7) & 0x1f)
90 #define auipc_imm(opcode) \ argument
91 ((((opcode) >> 12) & 0xfffff) << 12)
94 #define auipc_offset(opcode) sign_extend64(auipc_imm(opcode), 31) argument
96 #define auipc_offset(opcode) auipc_imm(opcode) argument
101 bool __kprobes simulate_auipc(u32 opcode, unsigned long addr, struct pt_regs *regs) in simulate_auipc() argument
110 u32 rd_idx = auipc_rd_idx(opcode); in simulate_auipc()
111 unsigned long rd_val = addr + auipc_offset(opcode); in simulate_auipc()
121 #define branch_rs1_idx(opcode) \ argument
122 (((opcode) >> 15) & 0x1f)
124 #define branch_rs2_idx(opcode) \ argument
125 (((opcode) >> 20) & 0x1f)
127 #define branch_funct3(opcode) \ argument
128 (((opcode) >> 12) & 0x7)
130 #define branch_imm(opcode) \ argument
131 (((((opcode) >> 8) & 0xf ) << 1) | \
132 ((((opcode) >> 25) & 0x3f) << 5) | \
133 ((((opcode) >> 7) & 0x1 ) << 11) | \
134 ((((opcode) >> 31) & 0x1 ) << 12))
136 #define branch_offset(opcode) \ argument
137 sign_extend32((branch_imm(opcode)), 12)
146 bool __kprobes simulate_branch(u32 opcode, unsigned long addr, struct pt_regs *regs) in simulate_branch() argument
166 if (!rv_insn_reg_get_val(regs, branch_rs1_idx(opcode), &rs1_val) || in simulate_branch()
167 !rv_insn_reg_get_val(regs, branch_rs2_idx(opcode), &rs2_val)) in simulate_branch()
170 offset_tmp = branch_offset(opcode); in simulate_branch()
171 switch (branch_funct3(opcode)) { in simulate_branch()