Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102821779
D33476.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D33476.diff
View Options
diff --git a/share/man/man9/intr_event.9 b/share/man/man9/intr_event.9
--- a/share/man/man9/intr_event.9
+++ b/share/man/man9/intr_event.9
@@ -200,39 +200,40 @@
flags.
.Sh EXAMPLES
The
-.Fn swi_add
+.Xr swi_add 9
function demonstrates the use of
.Fn intr_event_create
and
.Fn intr_event_add_handler .
.Bd -literal -offset indent
int
-swi_add(struct ithd **ithdp, const char *name, driver_intr_t handler,
- void *arg, int pri, enum intr_type flags, void **cookiep)
+swi_add(struct intr_event **eventp, const char *name, driver_intr_t handler,
+ void *arg, int pri, enum intr_type flags, void **cookiep)
{
- struct proc *p;
- struct ithd *ithd;
- int error;
+ struct intr_event *ie;
+ int error = 0;
if (flags & INTR_ENTROPY)
return (EINVAL);
- ithd = (ithdp != NULL) ? *ithdp : NULL;
+ ie = (eventp != NULL) ? *eventp : NULL;
- if (ithd != NULL) {
- if ((ithd->it_flags & IT_SOFT) == 0)
- return(EINVAL);
+ if (ie != NULL) {
+ if (!(ie->ie_flags & IE_SOFT))
+ return (EINVAL);
} else {
- error = ithread_create(&ithd, pri, IT_SOFT, NULL, NULL,
- "swi%d:", pri);
+ error = intr_event_create(&ie, NULL, IE_SOFT, 0,
+ NULL, NULL, NULL, swi_assign_cpu, "swi%d:", pri);
if (error)
return (error);
-
- if (ithdp != NULL)
- *ithdp = ithd;
+ if (eventp != NULL)
+ *eventp = ie;
+ }
+ if (handler != NULL) {
+ error = intr_event_add_handler(ie, name, NULL, handler, arg,
+ PI_SWI(pri), flags, cookiep);
}
- return (ithread_add_handler(ithd, name, handler, arg, pri + PI_SOFT,
- flags, cookiep));
+ return (error);
}
.Ed
.Sh ERRORS
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 3:28 PM (21 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14700009
Default Alt Text
D33476.diff (1 KB)
Attached To
Mode
D33476: ithread(9): update the example of swi_add()
Attached
Detach File
Event Timeline
Log In to Comment