kern_switch.c (83601) | kern_switch.c (88088) |
---|---|
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 83601 2001-09-18 03:36:21Z jlemon $ | 26 * $FreeBSD: head/sys/kern/kern_switch.c 88088 2001-12-18 00:27:18Z jhb $ |
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> --- 29 unchanged lines hidden (view full) --- 64} 65 66void 67setrunqueue(struct thread *td) 68{ 69 runq_add(&runq, td->td_kse); 70} 71 | 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> --- 29 unchanged lines hidden (view full) --- 64} 65 66void 67setrunqueue(struct thread *td) 68{ 69 runq_add(&runq, td->td_kse); 70} 71 |
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(); 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 94 td->td_critnest--; 95} 96 |
|
72/* 73 * Clear the status bit of the queue corresponding to priority level pri, 74 * indicating that it is empty. 75 */ 76static __inline void 77runq_clrbit(struct runq *rq, int pri) 78{ 79 struct rqbits *rqb; --- 198 unchanged lines hidden --- | 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) 103{ 104 struct rqbits *rqb; --- 198 unchanged lines hidden --- |