diff options
author | jhb <jhb@FreeBSD.org> | 2001-06-29 19:51:37 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-06-29 19:51:37 +0000 |
commit | cbc88996c619bc138b998f7e31c069ea60dcdefc (patch) | |
tree | 6a6509e044c3122df2e8a743db5230863c091dd8 /sys/amd64 | |
parent | 8d232144a3e4758c8a4a8500238cb227ce7500ac (diff) | |
download | FreeBSD-src-cbc88996c619bc138b998f7e31c069ea60dcdefc.zip FreeBSD-src-cbc88996c619bc138b998f7e31c069ea60dcdefc.tar.gz |
Move ast() and userret() to sys/kern/subr_trap.c now that they are MI.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/trap.c | 120 |
1 files changed, 0 insertions, 120 deletions
diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c index f6a9e0c..ebf6c67 100644 --- a/sys/amd64/amd64/trap.c +++ b/sys/amd64/amd64/trap.c @@ -163,54 +163,6 @@ SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RW, extern char *syscallnames[]; #endif -void -userret(p, frame, oticks) - struct proc *p; - struct trapframe *frame; - u_quad_t oticks; -{ - int sig; - - PROC_LOCK(p); - while ((sig = CURSIG(p)) != 0) - postsig(sig); - - mtx_lock_spin(&sched_lock); - PROC_UNLOCK_NOSWITCH(p); - p->p_pri.pri_level = p->p_pri.pri_user; - if (resched_wanted(p)) { - /* - * Since we are curproc, clock will normally just change - * our priority without moving us from one queue to another - * (since the running process is not on a queue.) - * If that happened after we setrunqueue ourselves but before we - * mi_switch()'ed, we might not be on the queue indicated by - * our priority. - */ - DROP_GIANT_NOSWITCH(); - setrunqueue(p); - p->p_stats->p_ru.ru_nivcsw++; - mi_switch(); - mtx_unlock_spin(&sched_lock); - PICKUP_GIANT(); - PROC_LOCK(p); - while ((sig = CURSIG(p)) != 0) - postsig(sig); - mtx_lock_spin(&sched_lock); - PROC_UNLOCK_NOSWITCH(p); - } - - /* - * Charge system time if profiling. - */ - if (p->p_sflag & PS_PROFIL) { - mtx_unlock_spin(&sched_lock); - addupc_task(p, TRAPF_PC(frame), - (u_int)(p->p_sticks - oticks) * psratio); - } else - mtx_unlock_spin(&sched_lock); -} - /* * Exception, fault, and trap interface to the FreeBSD kernel. * This common code is called from assembly language IDT gate entry @@ -1255,75 +1207,3 @@ bad: mtx_assert(&sched_lock, MA_NOTOWNED); mtx_assert(&Giant, MA_NOTOWNED); } - -void -ast(framep) - struct trapframe *framep; -{ - struct proc *p = CURPROC; - u_quad_t sticks; -#if defined(DEV_NPX) && !defined(SMP) - int ucode; -#endif - - KASSERT(TRAPF_USERMODE(framep), ("ast in kernel mode")); - - /* - * We check for a pending AST here rather than in the assembly as - * acquiring and releasing mutexes in assembly is not fun. - */ - mtx_lock_spin(&sched_lock); - if (!(astpending(p) || resched_wanted(p))) { - mtx_unlock_spin(&sched_lock); - return; - } - - sticks = p->p_sticks; - p->p_frame = framep; - - astoff(p); - cnt.v_soft++; - mtx_intr_enable(&sched_lock); - if (p->p_sflag & PS_OWEUPC) { - p->p_sflag &= ~PS_OWEUPC; - mtx_unlock_spin(&sched_lock); - mtx_lock(&Giant); - addupc_task(p, p->p_stats->p_prof.pr_addr, - p->p_stats->p_prof.pr_ticks); - mtx_lock_spin(&sched_lock); - } - if (p->p_sflag & PS_ALRMPEND) { - p->p_sflag &= ~PS_ALRMPEND; - mtx_unlock_spin(&sched_lock); - PROC_LOCK(p); - psignal(p, SIGVTALRM); - PROC_UNLOCK(p); - mtx_lock_spin(&sched_lock); - } -#if defined(DEV_NPX) && !defined(SMP) - if (PCPU_GET(curpcb)->pcb_flags & PCB_NPXTRAP) { - PCPU_GET(curpcb)->pcb_flags &= ~PCB_NPXTRAP; - mtx_unlock_spin(&sched_lock); - ucode = npxtrap(); - if (ucode != -1) { - if (!mtx_owned(&Giant)) - mtx_lock(&Giant); - trapsignal(p, SIGFPE, ucode); - } - mtx_lock_spin(&sched_lock); - } -#endif - if (p->p_sflag & PS_PROFPEND) { - p->p_sflag &= ~PS_PROFPEND; - mtx_unlock_spin(&sched_lock); - PROC_LOCK(p); - psignal(p, SIGPROF); - PROC_UNLOCK(p); - } else - mtx_unlock_spin(&sched_lock); - - userret(p, framep, sticks); - - if (mtx_owned(&Giant)) - mtx_unlock(&Giant); -} |