Lines Matching refs:rp

193 die(uint_t type, struct regs *rp, caddr_t addr, processorid_t cpuid)
210 ti.trap_regs = rp;
217 panic("BAD TRAP: type=%x (#%s %s) rp=%p addr=%p "
219 type, trap_mnemonic, trap_name, (void *)rp, (void *)addr,
220 mod_containing_pc((caddr_t)rp->r_pc),
225 panic("BAD TRAP: type=%x (#%s %s) rp=%p addr=%p",
226 type, trap_mnemonic, trap_name, (void *)rp, (void *)addr);
302 ldt_rewrite_syscall(struct regs *rp, proc_t *p, int syscall_insn)
309 if (linear_pc(rp, p, &linearpc) == 0) {
404 emulate_lsahf(struct regs *rp, uchar_t instr)
408 rp->r_ps = (rp->r_ps & ~0xff) |
409 ((rp->r_rax >> 8) & PSL_LSAHFMASK) | PS_MB1;
412 rp->r_rax = (rp->r_rax & ~0xff00) |
413 (((rp->r_ps & PSL_LSAHFMASK) | PS_MB1) << 8);
415 rp->r_pc += LSAHFSIZE;
465 trap(struct regs *rp, caddr_t addr, processorid_t cpuid)
492 type = rp->r_trapno;
498 errcode = rp->r_err;
501 else if ((caddr_t)rp->r_pc == addr ||
535 showregs(type, rp, addr);
537 if (USERMODE(rp->r_cs)) {
557 ASSERT(lwptoregs(lwp) == rp);
562 if ((caddr_t)rp->r_pc == addr)
588 (ulong_t)type, (ulong_t)rp);
600 showregs(type, rp, (caddr_t)0);
605 siginfo.si_addr = (caddr_t)rp->r_pc;
610 (void) die(type, rp, addr, cpuid);
623 rp->r_pc = ct->t_ontrap->ot_trampoline;
637 (void) die(type, rp, addr, cpuid);
687 uintptr_t rip = rp->r_pc;
695 rp->r_pc = rip;
710 caddr_t pc = (caddr_t)rp->r_pc;
724 (void *)rp->r_pc);
729 (void) die(type, rp, addr, cpuid);
734 (void) die(type, rp, addr, cpuid);
740 showregs(type, rp, addr);
741 traceregs(rp);
747 rp->r_r0 = res;
748 rp->r_pc = ct->t_lofault;
794 if (rp->r_pc <= 0xffffffff)
814 if (watchpage && addr == (caddr_t)rp->r_sp &&
815 rw == S_READ && instr_is_lcall_syscall((caddr_t)rp->r_pc)) {
818 rp->r_pc += LCALLSIZE;
824 if (!watchpage || (sz = instr_size(rp, &vaddr, rw)) <= 0)
830 watchcode, rp->r_pc);
838 siginfo.si_pc = (caddr_t)rp->r_pc;
844 if (rw != S_EXEC && pr_watch_emul(rp, vaddr, rw))
882 addr != (caddr_t)rp->r_pc &&
883 instr_is_prefetch((caddr_t)rp->r_pc)) {
887 (void *)rp->r_pc, p->p_pid);
894 showregs(type, rp, addr);
939 ldt_rewrite_syscall(rp, p, X86FSET_ASYSC))
948 instr_is_lsahf((caddr_t)rp->r_pc, &instr)) {
949 emulate_lsahf(rp, instr);
957 showregs(type, rp, (caddr_t)0);
960 siginfo.si_addr = (caddr_t)rp->r_pc;
966 showregs(type, rp, (caddr_t)0);
969 siginfo.si_addr = (caddr_t)rp->r_pc;
975 showregs(type, rp, (caddr_t)0);
978 siginfo.si_addr = (caddr_t)rp->r_pc;
984 showregs(type, rp, addr);
985 if (fpnoextflt(rp)) {
988 siginfo.si_addr = (caddr_t)rp->r_pc;
997 if (rp->r_pc != (uintptr_t)ndptrap_frstor) {
999 (void) die(type, rp, addr, cpuid);
1006 showregs(type, rp, addr);
1007 if (fpextovrflt(rp)) {
1010 siginfo.si_addr = (caddr_t)rp->r_pc;
1019 if (rp->r_pc != (uintptr_t)ndptrap_frstor) {
1021 (void) die(type, rp, addr, cpuid);
1029 showregs(type, rp, addr);
1030 if (sicode = fpexterrflt(rp)) {
1033 siginfo.si_addr = (caddr_t)rp->r_pc;
1040 showregs(type, rp, addr);
1050 siginfo.si_addr = (caddr_t)rp->r_pc;
1053 } else if ((sicode = fpsimderrflt(rp)) != 0) {
1056 siginfo.si_addr = (caddr_t)rp->r_pc;
1072 showregs(type, rp, (caddr_t)0);
1074 (void) die(type, rp, addr, cpuid);
1092 if (rp->r_pc == (uintptr_t)sys_sysenter ||
1093 rp->r_pc == (uintptr_t)brand_sys_sysenter) {
1103 if (rp->r_pc == (uintptr_t)sys_sysenter)
1104 rp->r_pc = (uintptr_t)
1107 rp->r_pc = (uintptr_t)
1112 else if (rp->r_pc == (uintptr_t)sys_call ||
1113 rp->r_pc == (uintptr_t)brand_sys_call) {
1120 showregs(type, rp, (caddr_t)0);
1123 rp->r_ps &= ~PS_T; /* turn off trace */
1134 (void) die(type, rp, addr, cpuid);
1175 showregs(type, rp, (caddr_t)0);
1176 rp->r_pc = ct->t_ontrap->ot_trampoline;
1190 showregs(type, rp, addr);
1191 traceregs(rp);
1193 rp->r_r0 = EFAULT;
1194 rp->r_pc = ct->t_lofault;
1216 showregs(type, rp, (caddr_t)0);
1217 rp->r_pc = ct->t_ontrap->ot_trampoline;
1224 showregs(type, rp, (caddr_t)0);
1225 if (kern_gpfault(rp))
1226 (void) die(type, rp, addr, cpuid);
1245 if (instr_is_lcall_syscall((caddr_t)rp->r_pc)) {
1261 * Since this is a not-present trap, rp->r_pc points to
1265 rp->r_pc += LCALLSIZE;
1266 lwp->lwp_regs = rp;
1292 ldt_rewrite_syscall(rp, p, X86FSET_SEP))
1301 showregs(type, rp, (caddr_t)0);
1304 siginfo.si_addr = (caddr_t)rp->r_pc;
1310 showregs(type, rp, (caddr_t)0);
1314 siginfo.si_addr = (caddr_t)rp->r_pc;
1320 showregs(type, rp, (caddr_t)0);
1326 rp->r_ps &= ~PS_T;
1338 siginfo.si_addr = (caddr_t)rp->r_pc;
1347 showregs(type, rp, (caddr_t)0);
1355 rp->r_pc--;
1358 siginfo.si_addr = (caddr_t)rp->r_pc;
1391 showregs(type, rp, (caddr_t)0);
1395 siginfo.si_addr = (caddr_t)rp->r_pc;
1435 profil_tick(rp->r_pc);
1452 deferred_singlestep_trap((caddr_t)rp->r_pc);
1508 rp->r_ps |= PS_T;
1512 rp->r_ps &= ~PS_T;
1670 showregs(uint_t type, struct regs *rp, caddr_t addr)
1694 USERMODE(rp->r_cs) ? "user": "kernel", (uintptr_t)addr);
1701 ttoproc(curthread)->p_pid : 0, rp->r_pc, rp->r_sp, rp->r_ps);
1724 dumpregs(rp);
1729 dumpregs(struct regs *rp)
1734 printf(fmt, "rdi", rp->r_rdi, "rsi", rp->r_rsi, "rdx", rp->r_rdx);
1735 printf(fmt, "rcx", rp->r_rcx, " r8", rp->r_r8, " r9", rp->r_r9);
1736 printf(fmt, "rax", rp->r_rax, "rbx", rp->r_rbx, "rbp", rp->r_rbp);
1737 printf(fmt, "r10", rp->r_r10, "r11", rp->r_r11, "r12", rp->r_r12);
1738 printf(fmt, "r13", rp->r_r13, "r14", rp->r_r14, "r15", rp->r_r15);
1741 " ds", rp->r_ds);
1742 printf(fmt, " es", rp->r_es, " fs", rp->r_fs, " gs", rp->r_gs);
1744 printf(fmt, "trp", rp->r_trapno, "err", rp->r_err, "rip", rp->r_rip);
1745 printf(fmt, " cs", rp->r_cs, "rfl", rp->r_rfl, "rsp", rp->r_rsp);
1747 printf("\t%3s: %16lx\n", " ss", rp->r_ss);
1752 printf(fmt, " gs", rp->r_gs, " fs", rp->r_fs,
1753 " es", rp->r_es, " ds", rp->r_ds);
1754 printf(fmt, "edi", rp->r_edi, "esi", rp->r_esi,
1755 "ebp", rp->r_ebp, "esp", rp->r_esp);
1756 printf(fmt, "ebx", rp->r_ebx, "edx", rp->r_edx,
1757 "ecx", rp->r_ecx, "eax", rp->r_eax);
1758 printf(fmt, "trp", rp->r_trapno, "err", rp->r_err,
1759 "eip", rp->r_eip, " cs", rp->r_cs);
1761 "efl", rp->r_efl, "usp", rp->r_uesp, " ss", rp->r_ss);
1865 kern_gpfault(struct regs *rp)
1871 caddr_t pc = (caddr_t)rp->r_pc;
1913 bcopy(rp, trp, offsetof(struct regs, r_pc));
1919 ASSERT(trp->r_err == rp->r_err);
1941 ASSERT((caddr_t)trp == (caddr_t)rp->r_sp);
1965 trp->r_trapno = rp->r_trapno;
1966 trp->r_err = rp->r_err;