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

Function intr_event_create

freebsd/kern/kern_intr.c:255–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

253}
254
255int
256intr_event_create(struct intr_event **event, void *source, int flags, int irq,
257 void (*pre_ithread)(void *), void (*post_ithread)(void *),
258 void (*post_filter)(void *), int (*assign_cpu)(void *, int),
259 const char *fmt, ...)
260{
261 struct intr_event *ie;
262 va_list ap;
263
264 /* The only valid flag during creation is IE_SOFT. */
265 if ((flags & ~IE_SOFT) != 0)
266 return (EINVAL);
267 ie = malloc(sizeof(struct intr_event), M_ITHREAD, M_WAITOK | M_ZERO);
268 ie->ie_source = source;
269 ie->ie_pre_ithread = pre_ithread;
270 ie->ie_post_ithread = post_ithread;
271 ie->ie_post_filter = post_filter;
272 ie->ie_assign_cpu = assign_cpu;
273 ie->ie_flags = flags;
274 ie->ie_irq = irq;
275 ie->ie_cpu = NOCPU;
276 CK_SLIST_INIT(&ie->ie_handlers);
277 mtx_init(&ie->ie_lock, "intr event", NULL, MTX_DEF);
278
279 va_start(ap, fmt);
280 vsnprintf(ie->ie_name, sizeof(ie->ie_name), fmt, ap);
281 va_end(ap);
282 strlcpy(ie->ie_fullname, ie->ie_name, sizeof(ie->ie_fullname));
283 mtx_lock(&event_lock);
284 TAILQ_INSERT_TAIL(&event_list, ie, ie_list);
285 mtx_unlock(&event_lock);
286 if (event != NULL)
287 *event = ie;
288 CTR2(KTR_INTR, "%s: created %s", __func__, ie->ie_name);
289 return (0);
290}
291
292/*
293 * Bind an interrupt event to the specified CPU. Note that not all

Callers 15

apb_setup_intrFunction · 0.85
qca955x_pci_setup_intrFunction · 0.85
ar71xx_pci_setup_intrFunction · 0.85
ar724x_pci_setup_intrFunction · 0.85
apb_setup_intrFunction · 0.85
cpu_establish_hardintrFunction · 0.85
cpu_establish_softintrFunction · 0.85
ciu_setup_intrFunction · 0.85
mtk_pci_setup_intrFunction · 0.85
gt_pci_setup_intrFunction · 0.85
cpu_establish_hardintrFunction · 0.85

Calls 6

mallocFunction · 0.85
mtx_initFunction · 0.85
vsnprintfFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70
strlcpyFunction · 0.50

Tested by

no test coverage detected