Lines 501-521
uart_bus_attach(device_t dev)
Link Here
|
501 |
* conditions. We may have broken H/W and polling is probably the |
501 |
* conditions. We may have broken H/W and polling is probably the |
502 |
* safest thing to do. |
502 |
* safest thing to do. |
503 |
*/ |
503 |
*/ |
504 |
if (filt != FILTER_SCHEDULE_THREAD) { |
504 |
if (filt != FILTER_SCHEDULE_THREAD) { |
505 |
sc->sc_irid = 0; |
505 |
sc->sc_irid = 0; |
506 |
sc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, |
506 |
sc->sc_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, |
507 |
&sc->sc_irid, RF_ACTIVE | RF_SHAREABLE); |
507 |
&sc->sc_irid, RF_ACTIVE | RF_SHAREABLE); |
508 |
} |
508 |
} |
509 |
if (sc->sc_ires != NULL) { |
509 |
if (sc->sc_ires != NULL) { |
510 |
error = bus_setup_intr(dev, sc->sc_ires, INTR_TYPE_TTY, |
510 |
error = bus_setup_intr(dev, sc->sc_ires, INTR_TYPE_TTY, |
511 |
uart_intr, NULL, sc, &sc->sc_icookie); |
511 |
uart_intr, (driver_intr_t *)uart_intr, sc, |
|
|
512 |
&sc->sc_icookie); |
512 |
sc->sc_fastintr = (error == 0) ? 1 : 0; |
513 |
sc->sc_fastintr = (error == 0) ? 1 : 0; |
513 |
|
514 |
|
514 |
if (!sc->sc_fastintr) |
515 |
if (!sc->sc_fastintr) |
515 |
error = bus_setup_intr(dev, sc->sc_ires, |
516 |
error = bus_setup_intr(dev, sc->sc_ires, |
516 |
INTR_TYPE_TTY | INTR_MPSAFE, NULL, |
517 |
INTR_TYPE_TTY | INTR_MPSAFE, NULL, |
517 |
(driver_intr_t *)uart_intr, sc, &sc->sc_icookie); |
518 |
(driver_intr_t *)uart_intr, sc, &sc->sc_icookie); |
518 |
|
519 |
|
519 |
if (error) { |
520 |
if (error) { |
520 |
device_printf(dev, "could not activate interrupt\n"); |
521 |
device_printf(dev, "could not activate interrupt\n"); |
521 |
bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irid, |
522 |
bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irid, |