Deleted Added
full compact
kern_switch.c (91751) kern_switch.c (93264)
1/*
2 * Copyright (c) 2001 Jake Burkholder <jake@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*
2 * Copyright (c) 2001 Jake Burkholder <jake@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/kern/kern_switch.c 91751 2002-03-06 15:34:07Z des $
26 * $FreeBSD: head/sys/kern/kern_switch.c 93264 2002-03-27 05:39:23Z dillon $
27 */
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/kernel.h>
32#include <sys/ktr.h>
33#include <sys/lock.h>
34#include <sys/mutex.h>

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

72/* Critical sections that prevent preemption. */
73void
74critical_enter(void)
75{
76 struct thread *td;
77
78 td = curthread;
79 if (td->td_critnest == 0)
27 */
28
29#include <sys/param.h>
30#include <sys/systm.h>
31#include <sys/kernel.h>
32#include <sys/ktr.h>
33#include <sys/lock.h>
34#include <sys/mutex.h>

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

72/* Critical sections that prevent preemption. */
73void
74critical_enter(void)
75{
76 struct thread *td;
77
78 td = curthread;
79 if (td->td_critnest == 0)
80 td->td_savecrit = cpu_critical_enter();
80 cpu_critical_enter();
81 td->td_critnest++;
82}
83
84void
85critical_exit(void)
86{
87 struct thread *td;
88
89 td = curthread;
90 if (td->td_critnest == 1) {
91 td->td_critnest = 0;
81 td->td_critnest++;
82}
83
84void
85critical_exit(void)
86{
87 struct thread *td;
88
89 td = curthread;
90 if (td->td_critnest == 1) {
91 td->td_critnest = 0;
92 cpu_critical_exit(td->td_savecrit);
93 } else
92 cpu_critical_exit();
93 } else {
94 td->td_critnest--;
94 td->td_critnest--;
95 }
95}
96
97/*
98 * Clear the status bit of the queue corresponding to priority level pri,
99 * indicating that it is empty.
100 */
101static __inline void
102runq_clrbit(struct runq *rq, int pri)

--- 198 unchanged lines hidden ---
96}
97
98/*
99 * Clear the status bit of the queue corresponding to priority level pri,
100 * indicating that it is empty.
101 */
102static __inline void
103runq_clrbit(struct runq *rq, int pri)

--- 198 unchanged lines hidden ---