Lines Matching refs:regs
123 void die_if_kernel (char *str, struct pt_regs *regs, long err);
125 static int emulate_ldh(struct pt_regs *regs, int toreg) in emulate_ldh() argument
127 unsigned long saddr = regs->ior; in emulate_ldh()
131 regs->isr, regs->ior, toreg); in emulate_ldh()
139 : "0" (val), "r" (saddr), "r" (regs->isr) in emulate_ldh()
145 regs->gr[toreg] = val; in emulate_ldh()
149 static int emulate_ldw(struct pt_regs *regs, int toreg) in emulate_ldw() argument
151 unsigned long saddr = regs->ior; in emulate_ldw()
155 regs->isr, regs->ior, toreg); in emulate_ldw()
167 : "0" (val), "r" (saddr), "r" (regs->isr) in emulate_ldw()
173 regs->gr[toreg] = val; in emulate_ldw()
178 static int emulate_ldd(struct pt_regs *regs, int toreg) in emulate_ldd() argument
180 unsigned long saddr = regs->ior; in emulate_ldd()
184 regs->isr, regs->ior, toreg); in emulate_ldd()
196 : "0" (val), "r" (saddr), "r" (regs->isr) in emulate_ldd()
202 regs->gr[toreg] = val; in emulate_ldd()
208 static int emulate_sth(struct pt_regs *regs, int frreg) in emulate_sth() argument
210 unsigned long val = regs->gr[frreg]; in emulate_sth()
215 regs->gr[frreg], regs->isr, regs->ior); in emulate_sth()
223 : "r" (val), "r" (regs->ior), "r" (regs->isr) in emulate_sth()
228 static int emulate_stw(struct pt_regs *regs, int frreg) in emulate_stw() argument
230 unsigned long val = regs->gr[frreg]; in emulate_stw()
235 regs->gr[frreg], regs->isr, regs->ior); in emulate_stw()
255 : "r" (val), "r" (regs->ior), "r" (regs->isr) in emulate_stw()
261 static int emulate_std(struct pt_regs *regs, int frreg) in emulate_std() argument
263 unsigned long val = regs->gr[frreg]; in emulate_std()
268 regs->gr[frreg], regs->isr, regs->ior); in emulate_std()
288 : "r" (val), "r" (regs->ior), "r" (regs->isr) in emulate_std()
295 void handle_unaligned(struct pt_regs *regs) in handle_unaligned() argument
299 unsigned long newbase = regs->gr[R1(regs->iir)]; in handle_unaligned()
309 if (!user_mode(regs)) in handle_unaligned()
317 fix = search_exception_table(regs->iaoq[0]); in handle_unaligned()
324 regs->gr[8] = -EFAULT; in handle_unaligned()
326 regs->gr[9] = 0; in handle_unaligned()
328 regs->iaoq[0] += ((fix->skip) & ~3); in handle_unaligned()
329 regs->iaoq[1] = regs->iaoq[0] + 4; in handle_unaligned()
330 regs->gr[0] &= ~PSW_B; in handle_unaligned()
337 if (user_mode(regs)) in handle_unaligned()
348 current->comm, current->pid, regs->ior, regs->iaoq[0]); in handle_unaligned()
351 show_regs(regs); in handle_unaligned()
360 switch (MAJOR_OP(regs->iir)) in handle_unaligned()
365 if (regs->iir&0x20) in handle_unaligned()
368 if (regs->iir&0x1000) /* short loads */ in handle_unaligned()
369 if (regs->iir&0x200) in handle_unaligned()
370 newbase += IM5_3(regs->iir); in handle_unaligned()
372 newbase += IM5_2(regs->iir); in handle_unaligned()
373 else if (regs->iir&0x2000) /* scaled indexed */ in handle_unaligned()
376 switch (regs->iir & OPCODE1_MASK) in handle_unaligned()
386 newbase += (R2(regs->iir)?regs->gr[R2(regs->iir)]:0)<<shift; in handle_unaligned()
388 newbase += (R2(regs->iir)?regs->gr[R2(regs->iir)]:0); in handle_unaligned()
394 newbase += IM14(regs->iir); in handle_unaligned()
398 if (regs->iir&8) in handle_unaligned()
401 newbase += IM14(regs->iir&~0xe); in handle_unaligned()
407 newbase += IM14(regs->iir&6); in handle_unaligned()
411 if (regs->iir&4) in handle_unaligned()
414 newbase += IM14(regs->iir&~4); in handle_unaligned()
419 if (regs->isr != regs->sr[7]) in handle_unaligned()
422 regs->isr, regs->sr[7]); in handle_unaligned()
430 switch (regs->iir & OPCODE1_MASK) in handle_unaligned()
434 ret = emulate_ldh(regs, R3(regs->iir)); in handle_unaligned()
441 ret = emulate_ldw(regs, R3(regs->iir)); in handle_unaligned()
445 ret = emulate_sth(regs, R2(regs->iir)); in handle_unaligned()
450 ret = emulate_stw(regs, R2(regs->iir)); in handle_unaligned()
458 ret = emulate_ldd(regs, R3(regs->iir)); in handle_unaligned()
463 ret = emulate_std(regs, R2(regs->iir)); in handle_unaligned()
475 switch (regs->iir & OPCODE2_MASK) in handle_unaligned()
479 ret = emulate_ldd(regs, R2(regs->iir)); in handle_unaligned()
484 ret = emulate_std(regs, R2(regs->iir)); in handle_unaligned()
488 switch (regs->iir & OPCODE3_MASK) in handle_unaligned()
492 ret = emulate_ldw(regs, R2(regs->iir)); in handle_unaligned()
497 ret = emulate_stw(regs, R2(regs->iir)); in handle_unaligned()
500 switch (regs->iir & OPCODE4_MASK) in handle_unaligned()
503 ret = emulate_ldh(regs, R2(regs->iir)); in handle_unaligned()
507 ret = emulate_ldw(regs, R2(regs->iir)); in handle_unaligned()
510 ret = emulate_sth(regs, R2(regs->iir)); in handle_unaligned()
514 ret = emulate_stw(regs, R2(regs->iir)); in handle_unaligned()
519 if (modify && R1(regs->iir)) in handle_unaligned()
520 regs->gr[R1(regs->iir)] = newbase; in handle_unaligned()
524 printk(KERN_CRIT "Not-handled unaligned insn 0x%08lx\n", regs->iir); in handle_unaligned()
531 die_if_kernel("Unaligned data reference", regs, 28); in handle_unaligned()
537 si.si_addr = (void *)regs->ior; in handle_unaligned()
544 regs->iaoq[0] = regs->iaoq[1]; in handle_unaligned()
545 regs->iaoq[1] = regs->iaoq[0] + 4; in handle_unaligned()
554 check_unaligned(struct pt_regs *regs) in check_unaligned() argument
561 switch (regs->iir & OPCODE1_MASK) { in check_unaligned()
579 switch (regs->iir & OPCODE4_MASK) { in check_unaligned()
594 return (int)(regs->ior & align_mask); in check_unaligned()