Deleted Added
full compact
kern_intr.c (72237) kern_intr.c (72376)
1/*
2 * Copyright (c) 1997, Stefan Esser <se@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 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
1/*
2 * Copyright (c) 1997, Stefan Esser <se@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 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/kern/kern_intr.c 72237 2001-02-09 17:42:43Z jhb $
26 * $FreeBSD: head/sys/kern/kern_intr.c 72376 2001-02-12 00:20:08Z jake $
27 *
28 */
29
30
31#include <sys/param.h>
32#include <sys/bus.h>
33#include <sys/rtprio.h>
34#include <sys/systm.h>

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

116
117 p = ithd->it_proc;
118 if (p == NULL)
119 return;
120
121 strncpy(p->p_comm, ithd->it_name, sizeof(ithd->it_name));
122 ih = TAILQ_FIRST(&ithd->it_handlers);
123 if (ih == NULL) {
27 *
28 */
29
30
31#include <sys/param.h>
32#include <sys/bus.h>
33#include <sys/rtprio.h>
34#include <sys/systm.h>

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

116
117 p = ithd->it_proc;
118 if (p == NULL)
119 return;
120
121 strncpy(p->p_comm, ithd->it_name, sizeof(ithd->it_name));
122 ih = TAILQ_FIRST(&ithd->it_handlers);
123 if (ih == NULL) {
124 p->p_rtprio.prio = RTP_PRIO_MAX;
124 p->p_pri.pri_level = PRI_MAX_ITHD;
125 ithd->it_flags &= ~IT_ENTROPY;
126 return;
127 }
128
129 entropy = 0;
125 ithd->it_flags &= ~IT_ENTROPY;
126 return;
127 }
128
129 entropy = 0;
130 p->p_rtprio.prio = ih->ih_pri;
130 p->p_pri.pri_level = ih->ih_pri;
131 TAILQ_FOREACH(ih, &ithd->it_handlers, ih_next) {
132 if (strlen(p->p_comm) + strlen(ih->ih_name) + 1 <
133 sizeof(p->p_comm)) {
134 strcat(p->p_comm, " ");
135 strcat(p->p_comm, ih->ih_name);
136 } else if (strlen(p->p_comm) + 1 == sizeof(p->p_comm)) {
137 if (p->p_comm[sizeof(p->p_comm) - 2] == '+')
138 p->p_comm[sizeof(p->p_comm) - 2] = '*';

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

174 va_end(ap);
175
176 error = kthread_create(ithread_loop, ithd, &p, RFSTOPPED | RFHIGHPID,
177 ithd->it_name);
178 if (error) {
179 free(ithd, M_ITHREAD);
180 return (error);
181 }
131 TAILQ_FOREACH(ih, &ithd->it_handlers, ih_next) {
132 if (strlen(p->p_comm) + strlen(ih->ih_name) + 1 <
133 sizeof(p->p_comm)) {
134 strcat(p->p_comm, " ");
135 strcat(p->p_comm, ih->ih_name);
136 } else if (strlen(p->p_comm) + 1 == sizeof(p->p_comm)) {
137 if (p->p_comm[sizeof(p->p_comm) - 2] == '+')
138 p->p_comm[sizeof(p->p_comm) - 2] = '*';

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

174 va_end(ap);
175
176 error = kthread_create(ithread_loop, ithd, &p, RFSTOPPED | RFHIGHPID,
177 ithd->it_name);
178 if (error) {
179 free(ithd, M_ITHREAD);
180 return (error);
181 }
182 p->p_rtprio.type = RTP_PRIO_ITHREAD;
183 p->p_rtprio.prio = RTP_PRIO_MAX;
182 p->p_pri.pri_class = PRI_ITHD;
183 p->p_pri.pri_level = PRI_MAX_ITHD;
184 p->p_stat = SWAIT;
185 ithd->it_proc = p;
186 p->p_ithd = ithd;
187 if (ithread != NULL)
188 *ithread = ithd;
189
190 return (0);
191}

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

315 p = ithd->it_proc;
316 PROC_LOCK(p);
317 if (pri == SWI_CLOCK)
318 p->p_flag |= P_NOLOAD;
319 PROC_UNLOCK(p);
320 if (ithdp != NULL)
321 *ithdp = ithd;
322 }
184 p->p_stat = SWAIT;
185 ithd->it_proc = p;
186 p->p_ithd = ithd;
187 if (ithread != NULL)
188 *ithread = ithd;
189
190 return (0);
191}

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

315 p = ithd->it_proc;
316 PROC_LOCK(p);
317 if (pri == SWI_CLOCK)
318 p->p_flag |= P_NOLOAD;
319 PROC_UNLOCK(p);
320 if (ithdp != NULL)
321 *ithdp = ithd;
322 }
323 return (ithread_add_handler(ithd, name, handler, arg, pri + PI_SOFT,
324 flags, cookiep));
323 return (ithread_add_handler(ithd, name, handler, arg,
324 (pri * RQ_PPQ) + PI_SOFT, flags, cookiep));
325}
326
327
328/*
329 * Schedule a heavyweight software interrupt process.
330 */
331void
332swi_sched(void *cookie, int flags)

--- 205 unchanged lines hidden ---
325}
326
327
328/*
329 * Schedule a heavyweight software interrupt process.
330 */
331void
332swi_sched(void *cookie, int flags)

--- 205 unchanged lines hidden ---