subr_trap.c (110190) | subr_trap.c (111024) |
---|---|
1/*- 2 * Copyright (C) 1994, David Greenman 3 * Copyright (c) 1990, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the University of Utah, and William Jolitz. 8 * --- 21 unchanged lines hidden (view full) --- 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 | 1/*- 2 * Copyright (C) 1994, David Greenman 3 * Copyright (c) 1990, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the University of Utah, and William Jolitz. 8 * --- 21 unchanged lines hidden (view full) --- 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 |
38 * $FreeBSD: head/sys/kern/subr_trap.c 110190 2003-02-01 12:17:09Z julian $ | 38 * $FreeBSD: head/sys/kern/subr_trap.c 111024 2003-02-17 02:19:58Z jeff $ |
39 */ 40 41#include "opt_mac.h" 42#ifdef __i386__ 43#include "opt_npx.h" 44#endif 45 46#include <sys/param.h> --- 72 unchanged lines hidden (view full) --- 119 * 120 * XXX should move PS_PROFIL to a place that can obviously be 121 * accessed safely without sched_lock. 122 */ 123 if (p->p_sflag & PS_PROFIL) { 124 quad_t ticks; 125 126 mtx_lock_spin(&sched_lock); | 39 */ 40 41#include "opt_mac.h" 42#ifdef __i386__ 43#include "opt_npx.h" 44#endif 45 46#include <sys/param.h> --- 72 unchanged lines hidden (view full) --- 119 * 120 * XXX should move PS_PROFIL to a place that can obviously be 121 * accessed safely without sched_lock. 122 */ 123 if (p->p_sflag & PS_PROFIL) { 124 quad_t ticks; 125 126 mtx_lock_spin(&sched_lock); |
127 ticks = ke->ke_sticks - oticks; | 127 ticks = td->td_sticks - oticks; |
128 mtx_unlock_spin(&sched_lock); 129 addupc_task(ke, TRAPF_PC(frame), (u_int)ticks * psratio); 130 } 131} 132 133/* 134 * Process an asynchronous software trap. 135 * This is relatively easy. --- 34 unchanged lines hidden (view full) --- 170 * This updates the p_sflag's for the checks below in one 171 * "atomic" operation with turning off the astpending flag. 172 * If another AST is triggered while we are handling the 173 * AST's saved in sflag, the astpending flag will be set and 174 * ast() will be called again. 175 */ 176 mtx_lock_spin(&sched_lock); 177 ke = td->td_kse; | 128 mtx_unlock_spin(&sched_lock); 129 addupc_task(ke, TRAPF_PC(frame), (u_int)ticks * psratio); 130 } 131} 132 133/* 134 * Process an asynchronous software trap. 135 * This is relatively easy. --- 34 unchanged lines hidden (view full) --- 170 * This updates the p_sflag's for the checks below in one 171 * "atomic" operation with turning off the astpending flag. 172 * If another AST is triggered while we are handling the 173 * AST's saved in sflag, the astpending flag will be set and 174 * ast() will be called again. 175 */ 176 mtx_lock_spin(&sched_lock); 177 ke = td->td_kse; |
178 sticks = ke->ke_sticks; | 178 sticks = td->td_sticks; |
179 flags = ke->ke_flags; 180 sflag = p->p_sflag; 181 p->p_sflag &= ~(PS_ALRMPEND | PS_NEEDSIGCHK | PS_PROFPEND | PS_XCPU); 182#ifdef MAC 183 p->p_sflag &= ~PS_MACPEND; 184#endif 185 ke->ke_flags &= ~(KEF_ASTPENDING | KEF_NEEDRESCHED | KEF_OWEUPC); 186 cnt.v_soft++; --- 76 unchanged lines hidden --- | 179 flags = ke->ke_flags; 180 sflag = p->p_sflag; 181 p->p_sflag &= ~(PS_ALRMPEND | PS_NEEDSIGCHK | PS_PROFPEND | PS_XCPU); 182#ifdef MAC 183 p->p_sflag &= ~PS_MACPEND; 184#endif 185 ke->ke_flags &= ~(KEF_ASTPENDING | KEF_NEEDRESCHED | KEF_OWEUPC); 186 cnt.v_soft++; --- 76 unchanged lines hidden --- |