Deleted Added
full compact
subr_trap.c (85525) subr_trap.c (88088)
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 85525 2001-10-26 08:12:54Z jhb $
38 * $FreeBSD: head/sys/kern/subr_trap.c 88088 2001-12-18 00:27:18Z jhb $
39 */
40
41#ifdef __i386__
42#include "opt_npx.h"
43#endif
44
45#include <sys/param.h>
46#include <sys/bus.h>

--- 89 unchanged lines hidden (view full) ---

136
137 KASSERT(TRAPF_USERMODE(framep), ("ast in kernel mode"));
138 KASSERT(td->td_ucred == NULL, ("leaked ucred"));
139#ifdef WITNESS
140 if (witness_list(td))
141 panic("Returning to user mode with mutex(s) held");
142#endif
143 mtx_assert(&Giant, MA_NOTOWNED);
39 */
40
41#ifdef __i386__
42#include "opt_npx.h"
43#endif
44
45#include <sys/param.h>
46#include <sys/bus.h>

--- 89 unchanged lines hidden (view full) ---

136
137 KASSERT(TRAPF_USERMODE(framep), ("ast in kernel mode"));
138 KASSERT(td->td_ucred == NULL, ("leaked ucred"));
139#ifdef WITNESS
140 if (witness_list(td))
141 panic("Returning to user mode with mutex(s) held");
142#endif
143 mtx_assert(&Giant, MA_NOTOWNED);
144 s = critical_enter();
144 s = cpu_critical_enter();
145 while ((ke->ke_flags & (KEF_ASTPENDING | KEF_NEEDRESCHED)) != 0) {
145 while ((ke->ke_flags & (KEF_ASTPENDING | KEF_NEEDRESCHED)) != 0) {
146 critical_exit(s);
146 cpu_critical_exit(s);
147 td->td_frame = framep;
148 /*
149 * This updates the p_sflag's for the checks below in one
150 * "atomic" operation with turning off the astpending flag.
151 * If another AST is triggered while we are handling the
152 * AST's saved in sflag, the astpending flag will be set and
153 * we will loop again.
154 */

--- 35 unchanged lines hidden (view full) ---

190 PROC_UNLOCK(p);
191 }
192
193 userret(td, framep, sticks);
194 mtx_lock(&Giant);
195 crfree(td->td_ucred);
196 mtx_unlock(&Giant);
197 td->td_ucred = NULL;
147 td->td_frame = framep;
148 /*
149 * This updates the p_sflag's for the checks below in one
150 * "atomic" operation with turning off the astpending flag.
151 * If another AST is triggered while we are handling the
152 * AST's saved in sflag, the astpending flag will be set and
153 * we will loop again.
154 */

--- 35 unchanged lines hidden (view full) ---

190 PROC_UNLOCK(p);
191 }
192
193 userret(td, framep, sticks);
194 mtx_lock(&Giant);
195 crfree(td->td_ucred);
196 mtx_unlock(&Giant);
197 td->td_ucred = NULL;
198 s = critical_enter();
198 s = cpu_critical_enter();
199 }
200 mtx_assert(&Giant, MA_NOTOWNED);
201 /*
202 * We need to keep interrupts disabled so that if any further AST's
203 * come in, the interrupt they come in on will be delayed until we
204 * finish returning to userland. We assume that the return to userland
199 }
200 mtx_assert(&Giant, MA_NOTOWNED);
201 /*
202 * We need to keep interrupts disabled so that if any further AST's
203 * come in, the interrupt they come in on will be delayed until we
204 * finish returning to userland. We assume that the return to userland
205 * will perform the equivalent of critical_exit().
205 * will perform the equivalent of cpu_critical_exit().
206 */
207}
206 */
207}