| 510 | } |
| 511 | |
| 512 | static int |
| 513 | cpu_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 | |
| 552 | static struct resource * |
| 553 | cpu_alloc_resource(device_t dev, device_t child, int type, int *rid, |
nothing calls this directly
no test coverage detected