28c28
< __FBSDID("$FreeBSD: head/sys/dev/atkbdc/atkbdc_isa.c 147271 2005-06-10 20:56:38Z marius $");
---
> __FBSDID("$FreeBSD: head/sys/dev/atkbdc/atkbdc_isa.c 158041 2006-04-26 06:05:16Z sobomax $");
95a96,101
> #if defined(__i386__)
> bus_space_tag_t tag;
> bus_space_handle_t ioh1;
> volatile int i;
> register_t flags;
> #endif
129a136,160
>
> #if defined(__i386__)
> /*
> * Check if we really have AT keyboard controller. Poll status
> * register until we get "all clear" indication. If no such
> * indication comes, it probably means that there is no AT
> * keyboard controller present. Give up in such case. Check relies
> * on the fact that reading from non-existing in/out port returns
> * 0xff on i386. May or may not be true on other platforms.
> */
> tag = rman_get_bustag(port0);
> ioh1 = rman_get_bushandle(port1);
> flags = intr_disable();
> for (i = 0; i != 65535; i++) {
> if ((bus_space_read_1(tag, ioh1, 0) & 0x2) == 0)
> break;
> }
> intr_restore(flags);
> if (i == 65535) {
> bus_release_resource(dev, SYS_RES_IOPORT, 0, port0);
> bus_release_resource(dev, SYS_RES_IOPORT, 1, port1);
> return ENXIO;
> }
> #endif
>
< __FBSDID("$FreeBSD: head/sys/dev/atkbdc/atkbdc_isa.c 147271 2005-06-10 20:56:38Z marius $");
---
> __FBSDID("$FreeBSD: head/sys/dev/atkbdc/atkbdc_isa.c 158041 2006-04-26 06:05:16Z sobomax $");
95a96,101
> #if defined(__i386__)
> bus_space_tag_t tag;
> bus_space_handle_t ioh1;
> volatile int i;
> register_t flags;
> #endif
129a136,160
>
> #if defined(__i386__)
> /*
> * Check if we really have AT keyboard controller. Poll status
> * register until we get "all clear" indication. If no such
> * indication comes, it probably means that there is no AT
> * keyboard controller present. Give up in such case. Check relies
> * on the fact that reading from non-existing in/out port returns
> * 0xff on i386. May or may not be true on other platforms.
> */
> tag = rman_get_bustag(port0);
> ioh1 = rman_get_bushandle(port1);
> flags = intr_disable();
> for (i = 0; i != 65535; i++) {
> if ((bus_space_read_1(tag, ioh1, 0) & 0x2) == 0)
> break;
> }
> intr_restore(flags);
> if (i == 65535) {
> bus_release_resource(dev, SYS_RES_IOPORT, 0, port0);
> bus_release_resource(dev, SYS_RES_IOPORT, 1, port1);
> return ENXIO;
> }
> #endif
>