MCPcopy Create free account
hub / github.com/F-Stack/f-stack / swi_add

Function swi_add

freebsd/kern/kern_intr.c:1018–1046  ·  view source on GitHub ↗

* Add a software interrupt handler to a specified event. If a given event * is not specified, then a new event is created. */

Source from the content-addressed store, hash-verified

1016 * is not specified, then a new event is created.
1017 */
1018int
1019swi_add(struct intr_event **eventp, const char *name, driver_intr_t handler,
1020 void *arg, int pri, enum intr_type flags, void **cookiep)
1021{
1022 struct intr_event *ie;
1023 int error = 0;
1024
1025 if (flags & INTR_ENTROPY)
1026 return (EINVAL);
1027
1028 ie = (eventp != NULL) ? *eventp : NULL;
1029
1030 if (ie != NULL) {
1031 if (!(ie->ie_flags & IE_SOFT))
1032 return (EINVAL);
1033 } else {
1034 error = intr_event_create(&ie, NULL, IE_SOFT, 0,
1035 NULL, NULL, NULL, swi_assign_cpu, "swi%d:", pri);
1036 if (error)
1037 return (error);
1038 if (eventp != NULL)
1039 *eventp = ie;
1040 }
1041 if (handler != NULL) {
1042 error = intr_event_add_handler(ie, name, NULL, handler, arg,
1043 PI_SWI(pri), flags, cookiep);
1044 }
1045 return (error);
1046}
1047
1048/*
1049 * Schedule a software interrupt thread.

Callers 7

start_softclockFunction · 0.70
subr_taskqueue.cFile · 0.70
start_softintrFunction · 0.70
pfattach_vnetFunction · 0.50
vnet_pfsync_initFunction · 0.50
tcp_init_hptsiFunction · 0.50
netisr_start_swiFunction · 0.50

Calls 2

intr_event_createFunction · 0.85
intr_event_add_handlerFunction · 0.85

Tested by

no test coverage detected