Lines Matching refs:insn

34 static inline enum direction decode_direction(unsigned int insn)  in decode_direction()  argument
36 unsigned long tmp = (insn >> 21) & 1; in decode_direction()
41 if(((insn>>19)&0x3f) == 15) in decode_direction()
49 static inline int decode_access_size(unsigned int insn) in decode_access_size() argument
51 insn = (insn >> 19) & 3; in decode_access_size()
53 if(!insn) in decode_access_size()
55 else if(insn == 3) in decode_access_size()
57 else if(insn == 2) in decode_access_size()
60 printk("Impossible unaligned trap. insn=%08x\n", insn); in decode_access_size()
67 static inline int decode_signedness(unsigned int insn) in decode_signedness() argument
69 return (insn & 0x400000); in decode_signedness()
137 unsigned int insn) in compute_effective_address() argument
139 unsigned int rs1 = (insn >> 14) & 0x1f; in compute_effective_address()
140 unsigned int rs2 = insn & 0x1f; in compute_effective_address()
141 unsigned int rd = (insn >> 25) & 0x1f; in compute_effective_address()
143 if(insn & 0x2000) { in compute_effective_address()
145 return (fetch_reg(rs1, regs) + sign_extend_imm13(insn)); in compute_effective_address()
153 unsigned int insn) in safe_compute_effective_address() argument
155 unsigned int rs1 = (insn >> 14) & 0x1f; in safe_compute_effective_address()
156 unsigned int rs2 = insn & 0x1f; in safe_compute_effective_address()
157 unsigned int rd = (insn >> 25) & 0x1f; in safe_compute_effective_address()
159 if(insn & 0x2000) { in safe_compute_effective_address()
161 return (safe_fetch_reg(rs1, regs) + sign_extend_imm13(insn)); in safe_compute_effective_address()
205 static inline int floating_point_load_or_store_p(unsigned int insn) in floating_point_load_or_store_p() argument
207 return (insn >> 24) & 1; in floating_point_load_or_store_p()
210 static inline int ok_for_kernel(unsigned int insn) in ok_for_kernel() argument
212 return !floating_point_load_or_store_p(insn); in ok_for_kernel()
215 static void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn) in kernel_mna_trap_fault() argument
221 unsigned long address = compute_effective_address(regs, insn); in kernel_mna_trap_fault()
240 asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn) in kernel_unaligned_trap() argument
242 enum direction dir = decode_direction(insn); in kernel_unaligned_trap()
243 int size = decode_access_size(insn); in kernel_unaligned_trap()
245 if(!ok_for_kernel(insn) || dir == both) { in kernel_unaligned_trap()
250 unsigned long addr = compute_effective_address(regs, insn); in kernel_unaligned_trap()
256 err = do_int_load(fetch_reg_addr(((insn>>25)&0x1f), in kernel_unaligned_trap()
259 decode_signedness(insn)); in kernel_unaligned_trap()
263 err = do_int_store(((insn>>25)&0x1f), size, in kernel_unaligned_trap()
271 kernel_mna_trap_fault(regs, insn); in kernel_unaligned_trap()
277 asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn) in user_unaligned_trap() argument
280 (void __user *)safe_compute_effective_address(regs, insn), in user_unaligned_trap()