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

Function apb_setup_intr

freebsd/mips/atheros/apb.c:285–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285static int
286apb_setup_intr(device_t bus, device_t child, struct resource *ires,
287 int flags, driver_filter_t *filt, driver_intr_t *handler,
288 void *arg, void **cookiep)
289{
290 struct apb_softc *sc = device_get_softc(bus);
291 struct intr_event *event;
292 int irq, error;
293
294 irq = rman_get_start(ires);
295
296 if (irq > APB_IRQ_END)
297 panic("%s: bad irq %d", __func__, irq);
298
299 event = sc->sc_eventstab[irq];
300 if (event == NULL) {
301 error = intr_event_create(&event, (void *)irq, 0, irq,
302 apb_mask_irq, apb_unmask_irq,
303 NULL, NULL,
304 "apb intr%d:", irq);
305
306 if (error == 0) {
307 sc->sc_eventstab[irq] = event;
308 sc->sc_intr_counter[irq] =
309 mips_intrcnt_create(event->ie_name);
310 }
311 else
312 return (error);
313 }
314
315 intr_event_add_handler(event, device_get_nameunit(child), filt,
316 handler, arg, intr_priority(flags), flags, cookiep);
317 mips_intrcnt_setname(sc->sc_intr_counter[irq], event->ie_fullname);
318
319 apb_unmask_irq((void*)irq);
320
321 return (0);
322}
323
324static int
325apb_teardown_intr(device_t dev, device_t child, struct resource *ires,

Callers

nothing calls this directly

Calls 10

device_get_softcFunction · 0.85
rman_get_startFunction · 0.85
intr_event_createFunction · 0.85
intr_event_add_handlerFunction · 0.85
device_get_nameunitFunction · 0.85
intr_priorityFunction · 0.85
apb_unmask_irqFunction · 0.70
panicFunction · 0.50
mips_intrcnt_createFunction · 0.50
mips_intrcnt_setnameFunction · 0.50

Tested by

no test coverage detected