kern_intr.c (198149) | kern_intr.c (198854) |
---|---|
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 --- 11 unchanged lines hidden (view full) --- 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 27#include <sys/cdefs.h> | 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 --- 11 unchanged lines hidden (view full) --- 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 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/kern/kern_intr.c 198149 2009-10-15 18:51:19Z jhb $"); | 28__FBSDID("$FreeBSD: head/sys/kern/kern_intr.c 198854 2009-11-03 16:46:52Z attilio $"); |
29 30#include "opt_ddb.h" 31 32#include <sys/param.h> 33#include <sys/bus.h> 34#include <sys/conf.h> 35#include <sys/cpuset.h> 36#include <sys/rtprio.h> --- 1019 unchanged lines hidden (view full) --- 1056/* 1057 * Add a software interrupt handler to a specified event. If a given event 1058 * is not specified, then a new event is created. 1059 */ 1060int 1061swi_add(struct intr_event **eventp, const char *name, driver_intr_t handler, 1062 void *arg, int pri, enum intr_type flags, void **cookiep) 1063{ | 29 30#include "opt_ddb.h" 31 32#include <sys/param.h> 33#include <sys/bus.h> 34#include <sys/conf.h> 35#include <sys/cpuset.h> 36#include <sys/rtprio.h> --- 1019 unchanged lines hidden (view full) --- 1056/* 1057 * Add a software interrupt handler to a specified event. If a given event 1058 * is not specified, then a new event is created. 1059 */ 1060int 1061swi_add(struct intr_event **eventp, const char *name, driver_intr_t handler, 1062 void *arg, int pri, enum intr_type flags, void **cookiep) 1063{ |
1064 struct thread *td; |
|
1064 struct intr_event *ie; 1065 int error; 1066 1067 if (flags & INTR_ENTROPY) 1068 return (EINVAL); 1069 1070 ie = (eventp != NULL) ? *eventp : NULL; 1071 --- 8 unchanged lines hidden (view full) --- 1080 if (eventp != NULL) 1081 *eventp = ie; 1082 } 1083 error = intr_event_add_handler(ie, name, NULL, handler, arg, 1084 (pri * RQ_PPQ) + PI_SOFT, flags, cookiep); 1085 if (error) 1086 return (error); 1087 if (pri == SWI_CLOCK) { | 1065 struct intr_event *ie; 1066 int error; 1067 1068 if (flags & INTR_ENTROPY) 1069 return (EINVAL); 1070 1071 ie = (eventp != NULL) ? *eventp : NULL; 1072 --- 8 unchanged lines hidden (view full) --- 1081 if (eventp != NULL) 1082 *eventp = ie; 1083 } 1084 error = intr_event_add_handler(ie, name, NULL, handler, arg, 1085 (pri * RQ_PPQ) + PI_SOFT, flags, cookiep); 1086 if (error) 1087 return (error); 1088 if (pri == SWI_CLOCK) { |
1088 struct proc *p; 1089 p = ie->ie_thread->it_thread->td_proc; 1090 PROC_LOCK(p); 1091 p->p_flag |= P_NOLOAD; 1092 PROC_UNLOCK(p); | 1089 td = ie->ie_thread->it_thread; 1090 thread_lock(td); 1091 td->td_flags |= TDF_NOLOAD; 1092 thread_unlock(td); |
1093 } 1094 return (0); 1095} 1096 1097/* 1098 * Schedule a software interrupt thread. 1099 */ 1100void --- 737 unchanged lines hidden --- | 1093 } 1094 return (0); 1095} 1096 1097/* 1098 * Schedule a software interrupt thread. 1099 */ 1100void --- 737 unchanged lines hidden --- |