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

Function mips_pic_attach

freebsd/mips/mips/mips_pic.c:218–261  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218static int
219mips_pic_attach(device_t dev)
220{
221 struct mips_pic_softc *sc;
222 intptr_t xref = pic_xref(dev);
223
224 if (pic_sc)
225 return (ENXIO);
226
227 sc = device_get_softc(dev);
228
229 sc->pic_dev = dev;
230 pic_sc = sc;
231
232 /* Set the number of interrupts */
233 sc->nirqs = nitems(sc->pic_irqs);
234
235 /* Register the interrupts */
236 if (mips_pic_register_isrcs(sc) != 0) {
237 device_printf(dev, "could not register PIC ISRCs\n");
238 goto cleanup;
239 }
240
241 /*
242 * Now, when everything is initialized, it's right time to
243 * register interrupt controller to interrupt framefork.
244 */
245 if (intr_pic_register(dev, xref) == NULL) {
246 device_printf(dev, "could not register PIC\n");
247 goto cleanup;
248 }
249
250 /* Claim our root controller role */
251 if (intr_pic_claim_root(dev, xref, mips_pic_intr, sc, 0) != 0) {
252 device_printf(dev, "could not set PIC as a root\n");
253 intr_pic_deregister(dev, xref);
254 goto cleanup;
255 }
256
257 return (0);
258
259cleanup:
260 return(ENXIO);
261}
262
263int
264mips_pic_intr(void *arg)

Callers

nothing calls this directly

Calls 7

device_get_softcFunction · 0.85
mips_pic_register_isrcsFunction · 0.85
device_printfFunction · 0.85
intr_pic_registerFunction · 0.85
intr_pic_claim_rootFunction · 0.85
intr_pic_deregisterFunction · 0.85
pic_xrefFunction · 0.70

Tested by

no test coverage detected