Lines Matching refs:regs

37 #define CHK_REMOTE_DEBUG(regs)                                               \  argument
39 if ((kgdb_debug_hook != (kgdb_debug_hook_t *) NULL) && (!user_mode(regs))) \
41 (*kgdb_debug_hook)(regs); \
45 #define CHK_REMOTE_DEBUG(regs) argument
51 struct pt_regs regs) \
56 if (is_dsp_inst(&regs)) { \
58 regs.sr |= SR_DSP; \
66 CHK_REMOTE_DEBUG(&regs); \
68 die_if_no_fixup(str,&regs,error_code); \
81 void die(const char * str, struct pt_regs * regs, long err) in die() argument
86 CHK_REMOTE_DEBUG(regs); in die()
87 show_regs(regs); in die()
92 static inline void die_if_kernel(const char * str, struct pt_regs * regs, long err) in die_if_kernel() argument
94 if (!user_mode(regs)) in die_if_kernel()
95 die(str, regs, err); in die_if_kernel()
107 static int die_if_no_fixup(const char * str, struct pt_regs * regs, long err) in die_if_no_fixup() argument
109 if (!user_mode(regs)) in die_if_no_fixup()
112 fixup = search_exception_table(regs->pc); in die_if_no_fixup()
114 regs->pc = fixup; in die_if_no_fixup()
117 die(str, regs, err); in die_if_no_fixup()
129 static int handle_unaligned_ins(u16 instruction, struct pt_regs *regs) in handle_unaligned_ins() argument
136 rn = &regs->regs[index]; in handle_unaligned_ins()
139 rm = &regs->regs[index]; in handle_unaligned_ins()
149 src += regs->regs[0]; in handle_unaligned_ins()
179 dst += regs->regs[0]; in handle_unaligned_ins()
253 src = (unsigned char*) &regs->regs[0]; in handle_unaligned_ins()
268 dst = (unsigned char*) &regs->regs[0]; in handle_unaligned_ins()
300 return die_if_no_fixup("Fault in unaligned fixup", regs, 0); in handle_unaligned_ins()
307 static inline int handle_unaligned_delayslot(struct pt_regs *regs) in handle_unaligned_delayslot() argument
311 if (copy_from_user(&instruction, (u16 *)(regs->pc+2), 2)) { in handle_unaligned_delayslot()
313 if (user_mode(regs)) in handle_unaligned_delayslot()
317 die("delay-slot-insn faulting in handle_unaligned_delayslot", regs, 0); in handle_unaligned_delayslot()
320 return handle_unaligned_ins(instruction,regs); in handle_unaligned_delayslot()
339 static int handle_unaligned_access(u16 instruction, struct pt_regs *regs) in handle_unaligned_access() argument
345 rm = regs->regs[index]; in handle_unaligned_access()
348 if (user_mode(regs) && handle_unaligned_notify_count>0) { in handle_unaligned_access()
352 current->comm,current->pid,(u16*)regs->pc,instruction); in handle_unaligned_access()
360 ret = handle_unaligned_delayslot(regs); in handle_unaligned_access()
362 regs->pc = regs->pr; in handle_unaligned_access()
366 ret = handle_unaligned_delayslot(regs); in handle_unaligned_access()
368 regs->pc += rm + 4; in handle_unaligned_access()
372 ret = handle_unaligned_delayslot(regs); in handle_unaligned_access()
374 regs->pr = regs->pc + 4; in handle_unaligned_access()
375 regs->pc += rm + 4; in handle_unaligned_access()
393 ret = handle_unaligned_delayslot(regs); in handle_unaligned_access()
395 regs->pc = rm; in handle_unaligned_access()
399 ret = handle_unaligned_delayslot(regs); in handle_unaligned_access()
401 regs->pr = regs->pc + 4; in handle_unaligned_access()
402 regs->pc = rm; in handle_unaligned_access()
426 ret = handle_unaligned_delayslot(regs); in handle_unaligned_access()
429 if ((regs->sr & 0x00000001) != 0) in handle_unaligned_access()
430 regs->pc += 4; /* next after slot */ in handle_unaligned_access()
433 regs->pc += SH_PC_8BIT_OFFSET(instruction); in handle_unaligned_access()
439 ret = handle_unaligned_delayslot(regs); in handle_unaligned_access()
442 if ((regs->sr & 0x00000001) == 0) in handle_unaligned_access()
443 regs->pc += 4; /* next after slot */ in handle_unaligned_access()
446 regs->pc += SH_PC_8BIT_OFFSET(instruction); in handle_unaligned_access()
453 ret = handle_unaligned_delayslot(regs); in handle_unaligned_access()
455 regs->pc += SH_PC_12BIT_OFFSET(instruction); in handle_unaligned_access()
459 ret = handle_unaligned_delayslot(regs); in handle_unaligned_access()
461 regs->pr = regs->pc + 4; in handle_unaligned_access()
462 regs->pc += SH_PC_12BIT_OFFSET(instruction); in handle_unaligned_access()
470 ret = handle_unaligned_ins(instruction,regs); in handle_unaligned_access()
472 regs->pc += 2; in handle_unaligned_access()
479 asmlinkage void do_address_error(struct pt_regs *regs, in do_address_error() argument
492 if (user_mode(regs)) { in do_address_error()
498 if (regs->pc & 1) in do_address_error()
502 if (copy_from_user(&instruction, (u16 *)(regs->pc), 2)) { in do_address_error()
510 tmp = handle_unaligned_access(instruction, regs); in do_address_error()
520 if (regs->pc & 1) in do_address_error()
521 die("unaligned program counter", regs, error_code); in do_address_error()
524 if (copy_from_user(&instruction, (u16 *)(regs->pc), 2)) { in do_address_error()
529 die("insn faulting in do_address_error", regs, 0); in do_address_error()
532 handle_unaligned_access(instruction, regs); in do_address_error()
541 int is_dsp_inst(struct pt_regs *regs) in is_dsp_inst() argument
545 get_user(inst, ((unsigned short *) regs->pc)); in is_dsp_inst()
556 #define is_dsp_inst(regs) (0) argument
564 struct pt_regs regs) in do_exception_error() argument
568 die_if_kernel("exception", &regs, ex); in do_exception_error()