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

Function cpu_attach

freebsd/mips/mips/cpu.c:512–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

510}
511
512static int
513cpu_attach(device_t dev)
514{
515 int error;
516#ifdef notyet
517 device_t clock;
518#endif
519
520 cpu_hardirq_rman.rm_start = 0;
521 cpu_hardirq_rman.rm_end = 5;
522 cpu_hardirq_rman.rm_type = RMAN_ARRAY;
523 cpu_hardirq_rman.rm_descr = "CPU Hard Interrupts";
524
525 error = rman_init(&cpu_hardirq_rman);
526 if (error != 0) {
527 device_printf(dev, "failed to initialize irq resources\n");
528 return (error);
529 }
530 /* XXX rman_manage_all. */
531 error = rman_manage_region(&cpu_hardirq_rman,
532 cpu_hardirq_rman.rm_start,
533 cpu_hardirq_rman.rm_end);
534 if (error != 0) {
535 device_printf(dev, "failed to manage irq resources\n");
536 return (error);
537 }
538
539 if (device_get_unit(dev) != 0)
540 panic("can't attach more cpus");
541 device_set_desc(dev, "MIPS32 processor");
542
543#ifdef notyet
544 clock = device_add_child(dev, "clock", device_get_unit(dev));
545 if (clock == NULL)
546 device_printf(dev, "clock failed to attach");
547#endif
548
549 return (bus_generic_attach(dev));
550}
551
552static struct resource *
553cpu_alloc_resource(device_t dev, device_t child, int type, int *rid,

Callers

nothing calls this directly

Calls 8

rman_initFunction · 0.85
device_printfFunction · 0.85
rman_manage_regionFunction · 0.85
device_get_unitFunction · 0.85
device_set_descFunction · 0.85
device_add_childFunction · 0.85
bus_generic_attachFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected