diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2011-07-06 21:41:38 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2011-07-06 21:41:38 +0000 |
commit | 1f8bec9fc5270feedd8a624a9d95c12ca9f84541 (patch) | |
tree | 00106427be1dff3557a53963b35c56d2cbf075a2 /sys/arch/sparc64 | |
parent | f303274e6cc4f87cb47de6f68f997d8a37c76e0f (diff) |
Clean up after P_BIGLOCK removal.
KERNEL_PROC_LOCK -> KERNEL_LOCK
KERNEL_PROC_UNLOCK -> KERNEL_UNLOCK
oga@ ok
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r-- | sys/arch/sparc64/fpu/fpu.c | 18 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/emul.c | 22 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/trap.c | 118 |
3 files changed, 79 insertions, 79 deletions
diff --git a/sys/arch/sparc64/fpu/fpu.c b/sys/arch/sparc64/fpu/fpu.c index 4c4b5ccb544..6c524414a0a 100644 --- a/sys/arch/sparc64/fpu/fpu.c +++ b/sys/arch/sparc64/fpu/fpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fpu.c,v 1.14 2010/01/01 13:13:07 miod Exp $ */ +/* $OpenBSD: fpu.c,v 1.15 2011/07/06 21:41:37 art Exp $ */ /* $NetBSD: fpu.c,v 1.11 2000/12/06 01:47:50 mrg Exp $ */ /* @@ -214,9 +214,9 @@ fpu_cleanup(p, fs) case FSR_TT_IEEE: if ((i = fsr & FSR_CX) == 0) panic("fpu ieee trap, but no exception"); - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGFPE, fpu_codes[i - 1], fpu_types[i - 1], sv); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); break; /* XXX should return, but queue remains */ case FSR_TT_UNFIN: @@ -239,9 +239,9 @@ fpu_cleanup(p, fs) log(LOG_ERR, "fpu hardware error (%s[%d])\n", p->p_comm, p->p_pid); uprintf("%s[%d]: fpu hardware error\n", p->p_comm, p->p_pid); - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGFPE, -1, FPE_FLTINV, sv); /* ??? */ - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); goto out; default: @@ -264,17 +264,17 @@ fpu_cleanup(p, fs) continue; case FPE: - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGFPE, fpu_codes[(fs->fs_fsr & FSR_CX) - 1], fpu_types[(fs->fs_fsr & FSR_CX) - 1], sv); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); break; case NOTFPU: - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGILL, 0, ILL_COPROC, sv); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); break; default: diff --git a/sys/arch/sparc64/sparc64/emul.c b/sys/arch/sparc64/sparc64/emul.c index 9fbdb976ce5..2e18cac3518 100644 --- a/sys/arch/sparc64/sparc64/emul.c +++ b/sys/arch/sparc64/sparc64/emul.c @@ -1,4 +1,4 @@ -/* $OpenBSD: emul.c,v 1.19 2010/11/27 19:41:48 miod Exp $ */ +/* $OpenBSD: emul.c,v 1.20 2011/07/06 21:41:37 art Exp $ */ /* $NetBSD: emul.c,v 1.8 2001/06/29 23:58:40 eeh Exp $ */ /*- @@ -333,9 +333,9 @@ emul_qf(int32_t insv, struct proc *p, union sigval sv, struct trapframe *tf) if (asi < ASI_PRIMARY) { /* privileged asi */ - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGILL, 0, ILL_PRVOPC, sv); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); return (0); } if (asi > ASI_SECONDARY_NOFAULT_LITTLE || @@ -346,29 +346,29 @@ emul_qf(int32_t insv, struct proc *p, union sigval sv, struct trapframe *tf) if ((freg & 3) != 0) { /* only valid for %fN where N % 4 = 0 */ - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGILL, 0, ILL_ILLOPN, sv); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); return (0); } if ((addr & 3) != 0) { /* request is not aligned */ - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGBUS, 0, BUS_ADRALN, sv); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); return (0); } fs = p->p_md.md_fpstate; if (fs == NULL) { - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); /* don't currently have an fpu context, get one */ fs = malloc(sizeof(*fs), M_SUBPROC, M_WAITOK); *fs = initfpstate; fs->fs_qsize = 0; p->p_md.md_fpstate = fs; - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); } else fpusave_proc(p, 1); @@ -393,10 +393,10 @@ emul_qf(int32_t insv, struct proc *p, union sigval sv, struct trapframe *tf) return (1); segv: - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGSEGV, isload ? VM_PROT_READ : VM_PROT_WRITE, SEGV_MAPERR, sv); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); return (0); } diff --git a/sys/arch/sparc64/sparc64/trap.c b/sys/arch/sparc64/sparc64/trap.c index ecb3a4f4e44..b0229d7292e 100644 --- a/sys/arch/sparc64/sparc64/trap.c +++ b/sys/arch/sparc64/sparc64/trap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: trap.c,v 1.69 2011/07/04 22:53:53 tedu Exp $ */ +/* $OpenBSD: trap.c,v 1.70 2011/07/06 21:41:37 art Exp $ */ /* $NetBSD: trap.c,v 1.73 2001/08/09 01:03:01 eeh Exp $ */ /* @@ -466,17 +466,17 @@ dopanic: pc, (long)tf->tf_npc, pstate, PSTATE_BITS); /* NOTREACHED */ } - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGILL, type, ILL_ILLOPC, sv); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); break; case T_AST: p->p_md.md_astpending = 0; if (p->p_flag & P_OWEUPC) { - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); ADDUPROF(p); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); } if (curcpu()->ci_want_resched) preempt(NULL); @@ -493,9 +493,9 @@ dopanic: */ write_user_windows(); if (rwindow_save(p) == -1) { - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGILL, 0, ILL_BADSTK, sv); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); } break; @@ -505,9 +505,9 @@ dopanic: if (copyin((caddr_t)pc, &ins, sizeof(ins)) != 0) { /* XXX Can this happen? */ - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGILL, 0, ILL_ILLOPC, sv); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); break; } if (ins.i_any.i_op == IOP_mem && @@ -526,9 +526,9 @@ dopanic: ADVANCE; break; } - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGILL, 0, ILL_ILLOPC, sv); /* XXX code? */ - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); break; } @@ -536,22 +536,22 @@ dopanic: case T_TEXTFAULT: case T_PRIVINST: case T_PRIVACT: - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGILL, 0, ILL_ILLOPC, sv); /* XXX code? */ - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); break; case T_FPDISABLED: { struct fpstate64 *fs = p->p_md.md_fpstate; if (fs == NULL) { - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); /* NOTE: fpstate must be 64-bit aligned */ fs = malloc((sizeof *fs), M_SUBPROC, M_WAITOK); *fs = initfpstate; fs->fs_qsize = 0; p->p_md.md_fpstate = fs; - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); } /* @@ -589,9 +589,9 @@ dopanic: if (copyin((caddr_t)pc, &ins, sizeof(ins)) != 0) { /* XXX Can this happen? */ - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGILL, 0, ILL_ILLOPC, sv); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); break; } if (ins.i_any.i_op == IOP_mem && @@ -602,9 +602,9 @@ dopanic: if (emul_qf(ins.i_int, p, sv, tf)) ADVANCE; } else { - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGILL, 0, ILL_ILLOPC, sv); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); } break; } @@ -619,7 +619,7 @@ dopanic: * core from the interrupt stack is not a good idea. * It causes random crashes. */ - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); sigexit(p, SIGKILL); /* NOTREACHED */ break; @@ -647,9 +647,9 @@ dopanic: } /* XXX sv.sival_ptr should be the fault address! */ - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGBUS, 0, BUS_ADRALN, sv); /* XXX code? */ - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); break; case T_FP_IEEE_754: @@ -684,22 +684,22 @@ dopanic: break; case T_TAGOF: - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGEMT, 0, EMT_TAGOVF, sv); /* XXX code? */ - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); break; case T_BREAKPOINT: - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGTRAP, 0, TRAP_BRKPT, sv); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); break; case T_DIV0: ADVANCE; - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGFPE, 0, FPE_INTDIV, sv); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); break; case T_CLEANWIN: @@ -715,25 +715,25 @@ dopanic: case T_RANGECHECK: ADVANCE; - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGILL, 0, ILL_ILLOPN, sv); /* XXX code? */ - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); break; case T_FIXALIGN: uprintf("T_FIXALIGN\n"); ADVANCE; - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGILL, 0, ILL_ILLOPN, sv); /* XXX code? */ - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); break; case T_INTOF: uprintf("T_INTOF\n"); /* XXX */ ADVANCE; - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGFPE, FPE_INTOVF_TRAP, FPE_INTOVF, sv); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); break; } userret(p); @@ -854,7 +854,7 @@ data_access_fault(tf, type, pc, addr, sfva, sfsr) goto kfault; } } else { - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); p->p_md.md_tf = tf; } @@ -919,7 +919,7 @@ kfault: } if ((tstate & TSTATE_PRIV) == 0) { - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); userret(p); share_fpu(p, tf); } else { @@ -993,9 +993,9 @@ data_access_error(tf, type, afva, afsr, sfva, sfsr) return; } - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGSEGV, VM_PROT_READ|VM_PROT_WRITE, SEGV_MAPERR, sv); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); out: if ((tstate & TSTATE_PRIV) == 0) { @@ -1045,7 +1045,7 @@ text_access_fault(tf, type, pc, sfsr) } else p->p_md.md_tf = tf; - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); vm = p->p_vmspace; /* alas! must call the horrible vm code */ @@ -1079,7 +1079,7 @@ text_access_fault(tf, type, pc, sfsr) trapsignal(p, SIGSEGV, access_type, SEGV_MAPERR, sv); } - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); if ((tstate & TSTATE_PRIV) == 0) { userret(p); @@ -1132,9 +1132,9 @@ text_access_error(tf, type, pc, sfsr, afva, afsr) panic("text_access_error: kernel memory error"); /* User fault -- Berr */ - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); trapsignal(p, SIGBUS, 0, BUS_ADRALN, sv); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); } if ((sfsr & SFSR_FV) == 0 || (sfsr & SFSR_FT) == 0) @@ -1153,7 +1153,7 @@ text_access_error(tf, type, pc, sfsr, afva, afsr) } else p->p_md.md_tf = tf; - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); vm = p->p_vmspace; /* alas! must call the horrible vm code */ @@ -1189,7 +1189,7 @@ text_access_error(tf, type, pc, sfsr, afva, afsr) trapsignal(p, SIGSEGV, access_type, SEGV_MAPERR, sv); } - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); out: if ((tstate & TSTATE_PRIV) == 0) { @@ -1318,9 +1318,9 @@ syscall(tf, code, pc) #ifdef KTRACE if (KTRPOINT(p, KTR_SYSCALL)) { - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); ktrsyscall(p, code, callp->sy_argsize, args); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); } #endif if (error) @@ -1331,25 +1331,25 @@ syscall(tf, code, pc) } #ifdef SYSCALL_DEBUG - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); scdebug_call(p, code, args); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); #endif rval[0] = 0; rval[1] = tf->tf_out[1]; #if NSYSTRACE > 0 if (ISSET(p->p_flag, P_SYSTRACE)) { - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); error = systrace_redirect(code, p, args, rval); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); } else #endif { if (lock) - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); error = (*callp->sy_call)(p, args, rval); if (lock) - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); } switch (error) { vaddr_t dest; @@ -1391,16 +1391,16 @@ syscall(tf, code, pc) } #ifdef SYSCALL_DEBUG - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); scdebug_ret(p, code, error, rval); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); #endif userret(p); #ifdef KTRACE if (KTRPOINT(p, KTR_SYSRET)) { - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); ktrsysret(p, code, error, rval[0]); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); } #endif share_fpu(p, tf); @@ -1423,17 +1423,17 @@ child_return(arg) tf->tf_out[1] = 0; tf->tf_tstate &= ~(((int64_t)(ICC_C|XCC_C))<<TSTATE_CCR_SHIFT); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); userret(p); #ifdef KTRACE if (KTRPOINT(p, KTR_SYSRET)) { - KERNEL_PROC_LOCK(p); + KERNEL_LOCK(); ktrsysret(p, (p->p_flag & P_THREAD) ? SYS_rfork : (p->p_p->ps_flags & PS_PPWAIT) ? SYS_vfork : SYS_fork, 0, 0); - KERNEL_PROC_UNLOCK(p); + KERNEL_UNLOCK(); } #endif } |