Lines Matching refs:regs
86 static int handle_unaligned_ins(insn_size_t instruction, struct pt_regs *regs, in handle_unaligned_ins() argument
95 rn = ®s->regs[index]; in handle_unaligned_ins()
98 rm = ®s->regs[index]; in handle_unaligned_ins()
115 srcu += regs->regs[0]; in handle_unaligned_ins()
133 dstu += regs->regs[0]; in handle_unaligned_ins()
194 src = (unsigned char *) ®s->regs[0]; in handle_unaligned_ins()
209 dst = (unsigned char *) ®s->regs[0]; in handle_unaligned_ins()
224 srcu = (unsigned char __user *)regs->pc; in handle_unaligned_ins()
241 srcu = (unsigned char __user *)(regs->pc & ~0x3); in handle_unaligned_ins()
258 die_if_no_fixup("Fault in unaligned fixup", regs, 0); in handle_unaligned_ins()
266 static inline int handle_delayslot(struct pt_regs *regs, in handle_delayslot() argument
271 void __user *addr = (void __user *)(regs->pc + in handle_delayslot()
276 if (user_mode(regs)) in handle_delayslot()
281 regs, 0); in handle_delayslot()
284 return handle_unaligned_ins(instruction, regs, ma); in handle_delayslot()
303 int handle_unaligned_access(insn_size_t instruction, struct pt_regs *regs, in handle_unaligned_access() argument
317 rm = regs->regs[index]; in handle_unaligned_access()
327 unaligned_fixups_notify(current, instruction, regs); in handle_unaligned_access()
329 regs, address); in handle_unaligned_access()
337 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
339 regs->pc = regs->pr; in handle_unaligned_access()
343 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
345 regs->pc += rm + 4; in handle_unaligned_access()
349 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
351 regs->pr = regs->pc + 4; in handle_unaligned_access()
352 regs->pc += rm + 4; in handle_unaligned_access()
370 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
372 regs->pc = rm; in handle_unaligned_access()
376 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
378 regs->pr = regs->pc + 4; in handle_unaligned_access()
379 regs->pc = rm; in handle_unaligned_access()
404 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
407 if ((regs->sr & 0x00000001) != 0) in handle_unaligned_access()
408 regs->pc += 4; /* next after slot */ in handle_unaligned_access()
411 regs->pc += SH_PC_8BIT_OFFSET(instruction); in handle_unaligned_access()
418 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
421 if ((regs->sr & 0x00000001) == 0) in handle_unaligned_access()
422 regs->pc += 4; /* next after slot */ in handle_unaligned_access()
425 regs->pc += SH_PC_8BIT_OFFSET(instruction); in handle_unaligned_access()
435 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
437 regs->pc += SH_PC_12BIT_OFFSET(instruction); in handle_unaligned_access()
441 ret = handle_delayslot(regs, instruction, ma); in handle_unaligned_access()
443 regs->pr = regs->pc + 4; in handle_unaligned_access()
444 regs->pc += SH_PC_12BIT_OFFSET(instruction); in handle_unaligned_access()
455 ret = handle_unaligned_ins(instruction, regs, ma); in handle_unaligned_access()
457 regs->pc += instruction_size(instruction); in handle_unaligned_access()
472 asmlinkage void do_address_error(struct pt_regs *regs, in do_address_error() argument
489 if (user_mode(regs)) { in do_address_error()
497 if (copy_from_user(&instruction, (insn_size_t *)(regs->pc & ~1), in do_address_error()
505 unaligned_fixups_notify(current, instruction, regs); in do_address_error()
514 regs->pc += instruction_size(instruction); in do_address_error()
520 if (regs->pc & 1) { in do_address_error()
526 tmp = handle_unaligned_access(instruction, regs, in do_address_error()
535 "access (PC %lx PR %lx)\n", current->comm, regs->pc, in do_address_error()
536 regs->pr); in do_address_error()
546 if (regs->pc & 1) in do_address_error()
547 die("unaligned program counter", regs, error_code); in do_address_error()
550 if (copy_from_user(&instruction, (void __user *)(regs->pc), in do_address_error()
556 die("insn faulting in do_address_error", regs, 0); in do_address_error()
559 unaligned_fixups_notify(current, instruction, regs); in do_address_error()
561 handle_unaligned_access(instruction, regs, &user_mem_access, in do_address_error()
571 int is_dsp_inst(struct pt_regs *regs) in is_dsp_inst() argument
579 if (!(current_cpu_data.flags & CPU_HAS_DSP) || (regs->sr & SR_DSP)) in is_dsp_inst()
582 get_user(inst, ((unsigned short *) regs->pc)); in is_dsp_inst()
593 #define is_dsp_inst(regs) (0) argument
616 struct pt_regs *regs = current_pt_regs(); in do_reserved_inst() local
624 get_user(inst, (unsigned short*)regs->pc); in do_reserved_inst()
626 err = do_fpu_inst(inst, regs); in do_reserved_inst()
628 regs->pc += instruction_size(inst); in do_reserved_inst()
636 if (is_dsp_inst(regs)) { in do_reserved_inst()
638 regs->sr |= SR_DSP; in do_reserved_inst()
649 die_if_no_fixup("reserved instruction", regs, error_code); in do_reserved_inst()
653 static int emulate_branch(unsigned short inst, struct pt_regs *regs) in emulate_branch() argument
669 regs->pr = regs->pc + 4; in emulate_branch()
672 regs->pc += SH_PC_8BIT_OFFSET(inst); in emulate_branch()
677 regs->pc += SH_PC_12BIT_OFFSET(inst); in emulate_branch()
682 regs->pc += regs->regs[(inst & 0x0f00) >> 8] + 4; in emulate_branch()
687 regs->pc = regs->regs[(inst & 0x0f00) >> 8]; in emulate_branch()
692 regs->pc = regs->pr; in emulate_branch()
702 struct pt_regs *regs = current_pt_regs(); in do_illegal_slot_inst() local
706 if (kprobe_handle_illslot(regs->pc) == 0) in do_illegal_slot_inst()
710 get_user(inst, (unsigned short *)regs->pc + 1); in do_illegal_slot_inst()
711 if (!do_fpu_inst(inst, regs)) { in do_illegal_slot_inst()
712 get_user(inst, (unsigned short *)regs->pc); in do_illegal_slot_inst()
713 if (!emulate_branch(inst, regs)) in do_illegal_slot_inst()
724 die_if_no_fixup("illegal slot instruction", regs, inst); in do_illegal_slot_inst()