Lines Matching refs:regs
45 struct pt_regs *regs);
51 unsigned long error_code, struct pt_regs *regs, struct task_struct *tsk);
54 asmlinkage void do_##name(unsigned long error_code, struct pt_regs *regs) \
56 do_unhandled_exception(trapnr, signr, str, __FUNCTION__, error_code, regs, current); \
61 void die(const char * str, struct pt_regs * regs, long err) in die() argument
66 show_regs(regs); in die()
71 static inline void die_if_kernel(const char * str, struct pt_regs * regs, long err) in die_if_kernel() argument
73 if (!user_mode(regs)) in die_if_kernel()
74 die(str, regs, err); in die_if_kernel()
77 static void die_if_no_fixup(const char * str, struct pt_regs * regs, long err) in die_if_no_fixup() argument
79 if (!user_mode(regs)) in die_if_no_fixup()
82 fixup = search_exception_table(regs->pc); in die_if_no_fixup()
84 regs->pc = fixup; in die_if_no_fixup()
87 die(str, regs, err); in die_if_no_fixup()
99 static int misaligned_fixup(struct pt_regs *regs);
101 asmlinkage void do_address_error_load(unsigned long error_code, struct pt_regs *regs) in do_address_error_load() argument
103 if (misaligned_fixup(regs) < 0) { in do_address_error_load()
105 error_code, regs, current); in do_address_error_load()
110 asmlinkage void do_address_error_store(unsigned long error_code, struct pt_regs *regs) in do_address_error_store() argument
112 if (misaligned_fixup(regs) < 0) { in do_address_error_store()
114 error_code, regs, current); in do_address_error_store()
144 void do_reserved_inst(unsigned long error_code, struct pt_regs *regs) in do_reserved_inst() argument
158 pc = regs->pc; in do_reserved_inst()
189 if (!user_mode(regs)) { in do_reserved_inst()
199 if (!user_mode(regs)) return; in do_reserved_inst()
233 …do_unhandled_exception(trapnr, signr, exception_name, "do_reserved_inst", error_code, regs, curren… in do_reserved_inst()
248 asmlinkage void do_exception_error(unsigned long ex, struct pt_regs *regs) in do_exception_error() argument
251 show_excp_regs(__FUNCTION__, -1, -1, regs); in do_exception_error()
252 die_if_kernel("exception", regs, ex); in do_exception_error()
255 int do_unknown_trapa(unsigned long scId, struct pt_regs *regs) in do_unknown_trapa() argument
260 die_if_kernel("unknown trapa", regs, scId); in do_unknown_trapa()
329 unsigned long error_code, struct pt_regs *regs, struct task_struct *tsk) in do_unhandled_exception() argument
331 show_excp_regs(fn_name, trapnr, signr, regs); in do_unhandled_exception()
334 if (user_mode(regs)) force_sig(signr, tsk); in do_unhandled_exception()
335 die_if_no_fixup(str, regs, error_code); in do_unhandled_exception()
375 static int generate_and_check_address(struct pt_regs *regs, in generate_and_check_address() argument
385 int do_as_user = user_mode(regs); in generate_and_check_address()
388 base_address = regs->regs[basereg]; in generate_and_check_address()
398 offset = regs->regs[offsetreg]; in generate_and_check_address()
459 static int misaligned_load(struct pt_regs *regs, in misaligned_load() argument
470 error = generate_and_check_address(regs, opcode, in misaligned_load()
478 if (user_mode(regs)) { in misaligned_load()
491 regs->regs[destreg] = (__u64)(__s64) *(__s16 *) &buffer; in misaligned_load()
493 regs->regs[destreg] = (__u64) *(__u16 *) &buffer; in misaligned_load()
497 regs->regs[destreg] = (__u64)(__s64) *(__s32 *) &buffer; in misaligned_load()
500 regs->regs[destreg] = buffer; in misaligned_load()
504 width_shift, (unsigned long) regs->pc); in misaligned_load()
515 misaligned_kernel_word_load(address, do_sign_extend, ®s->regs[destreg]); in misaligned_load()
520 regs->regs[destreg] = lo | hi; in misaligned_load()
525 regs->regs[destreg] = lo | hi; in misaligned_load()
530 width_shift, (unsigned long) regs->pc); in misaligned_load()
539 static int misaligned_store(struct pt_regs *regs, in misaligned_store() argument
549 error = generate_and_check_address(regs, opcode, in misaligned_store()
557 if (user_mode(regs)) { in misaligned_store()
566 *(__u16 *) &buffer = (__u16) regs->regs[srcreg]; in misaligned_store()
569 *(__u32 *) &buffer = (__u32) regs->regs[srcreg]; in misaligned_store()
572 buffer = regs->regs[srcreg]; in misaligned_store()
576 width_shift, (unsigned long) regs->pc); in misaligned_store()
587 __u64 val = regs->regs[srcreg]; in misaligned_store()
604 width_shift, (unsigned long) regs->pc); in misaligned_store()
616 static int misaligned_fpu_load(struct pt_regs *regs, in misaligned_fpu_load() argument
627 error = generate_and_check_address(regs, opcode, in misaligned_fpu_load()
634 if (user_mode(regs)) { in misaligned_fpu_load()
653 regs->sr |= SR_FD; in misaligned_fpu_load()
679 width_shift, (unsigned long) regs->pc); in misaligned_fpu_load()
684 die ("Misaligned FPU load inside kernel", regs, 0); in misaligned_fpu_load()
691 static int misaligned_fpu_store(struct pt_regs *regs, in misaligned_fpu_store() argument
702 error = generate_and_check_address(regs, opcode, in misaligned_fpu_store()
709 if (user_mode(regs)) { in misaligned_fpu_store()
726 regs->sr |= SR_FD; in misaligned_fpu_store()
749 width_shift, (unsigned long) regs->pc); in misaligned_fpu_store()
760 die ("Misaligned FPU load inside kernel", regs, 0); in misaligned_fpu_store()
766 static int misaligned_fixup(struct pt_regs *regs) in misaligned_fixup() argument
779 error = read_opcode(regs->pc, &opcode); in misaligned_fixup()
787 if (user_mode(regs) && (user_mode_unaligned_fixup_count > 0)) { in misaligned_fixup()
791 current->comm, current->pid, (__u32)regs->pc, opcode); in misaligned_fixup()
794 if (!user_mode(regs) && (kernel_mode_unaligned_fixup_count > 0)) { in misaligned_fixup()
798 (__u32)regs->pc, opcode); in misaligned_fixup()
801 current->comm, current->pid, (__u32)regs->pc, opcode); in misaligned_fixup()
808 error = misaligned_load(regs, opcode, 1, 1, 1); in misaligned_fixup()
811 error = misaligned_load(regs, opcode, 1, 1, 0); in misaligned_fixup()
814 error = misaligned_load(regs, opcode, 1, 2, 1); in misaligned_fixup()
817 error = misaligned_load(regs, opcode, 1, 3, 0); in misaligned_fixup()
821 error = misaligned_store(regs, opcode, 1, 1); in misaligned_fixup()
824 error = misaligned_store(regs, opcode, 1, 2); in misaligned_fixup()
827 error = misaligned_store(regs, opcode, 1, 3); in misaligned_fixup()
833 error = misaligned_load(regs, opcode, 0, 1, 1); in misaligned_fixup()
836 error = misaligned_load(regs, opcode, 0, 1, 0); in misaligned_fixup()
839 error = misaligned_load(regs, opcode, 0, 2, 1); in misaligned_fixup()
842 error = misaligned_load(regs, opcode, 0, 3, 0); in misaligned_fixup()
853 error = misaligned_store(regs, opcode, 0, 1); in misaligned_fixup()
856 error = misaligned_store(regs, opcode, 0, 2); in misaligned_fixup()
859 error = misaligned_store(regs, opcode, 0, 3); in misaligned_fixup()
869 error = misaligned_fpu_load(regs, opcode, 1, 2, 0); in misaligned_fixup()
872 error = misaligned_fpu_load(regs, opcode, 1, 3, 1); in misaligned_fixup()
875 error = misaligned_fpu_load(regs, opcode, 1, 3, 0); in misaligned_fixup()
880 error = misaligned_fpu_load(regs, opcode, 0, 2, 0); in misaligned_fixup()
883 error = misaligned_fpu_load(regs, opcode, 0, 3, 1); in misaligned_fixup()
886 error = misaligned_fpu_load(regs, opcode, 0, 3, 0); in misaligned_fixup()
894 error = misaligned_fpu_store(regs, opcode, 1, 2, 0); in misaligned_fixup()
897 error = misaligned_fpu_store(regs, opcode, 1, 3, 1); in misaligned_fixup()
900 error = misaligned_fpu_store(regs, opcode, 1, 3, 0); in misaligned_fixup()
905 error = misaligned_fpu_store(regs, opcode, 0, 2, 0); in misaligned_fixup()
908 error = misaligned_fpu_store(regs, opcode, 0, 3, 1); in misaligned_fixup()
911 error = misaligned_fpu_store(regs, opcode, 0, 3, 0); in misaligned_fixup()
929 regs->pc += 4; /* Skip the instruction that's just been emulated */ in misaligned_fixup()