* Check to see if we have what looks like a valid ELCR. We do this by * verifying that IRQs 0, 1, 2, and 13 are all edge triggered. */
| 62 | * verifying that IRQs 0, 1, 2, and 13 are all edge triggered. |
| 63 | */ |
| 64 | int |
| 65 | elcr_probe(void) |
| 66 | { |
| 67 | int i; |
| 68 | |
| 69 | elcr_status = inb(ELCR_PORT) | inb(ELCR_PORT + 1) << 8; |
| 70 | if ((elcr_status & (ELCR_MASK(0) | ELCR_MASK(1) | ELCR_MASK(2) | |
| 71 | ELCR_MASK(8) | ELCR_MASK(13))) != 0) |
| 72 | return (ENXIO); |
| 73 | if (bootverbose) { |
| 74 | printf("ELCR Found. ISA IRQs programmed as:\n"); |
| 75 | for (i = 0; i < 16; i++) |
| 76 | printf(" %2d", i); |
| 77 | printf("\n"); |
| 78 | for (i = 0; i < 16; i++) |
| 79 | if (elcr_status & ELCR_MASK(i)) |
| 80 | printf(" L"); |
| 81 | else |
| 82 | printf(" E"); |
| 83 | printf("\n"); |
| 84 | } |
| 85 | if (resource_disabled("elcr", 0)) |
| 86 | return (ENXIO); |
| 87 | elcr_found = 1; |
| 88 | return (0); |
| 89 | } |
| 90 | |
| 91 | /* |
| 92 | * Returns 1 for level trigger, 0 for edge. |
no test coverage detected