--- src/sys/bus/ppbus/ppbconf.c 2005/05/24 20:58:53 1.6 +++ src/sys/bus/ppbus/ppbconf.c 2005/06/02 20:40:37 1.7 @@ -35,6 +35,7 @@ #include #include #include +#include #include "ppbconf.h" #include "ppb_1284.h" @@ -457,15 +458,14 @@ ppbus_teardown_intr(device_t bus, device int ppb_request_bus(device_t bus, device_t dev, int how) { - int s, error = 0; + int error = 0; struct ppb_data *ppb = DEVTOSOFTC(bus); struct ppb_device *ppbdev = (struct ppb_device *)device_get_ivars(dev); while (!error) { - s = splhigh(); + crit_enter(); if (ppb->ppb_owner) { - splx(s); - + crit_exit(); switch (how) { case (PPB_WAIT | PPB_INTR): error = tsleep(ppb, PCATCH, "ppbreq", 0); @@ -492,7 +492,7 @@ ppb_request_bus(device_t bus, device_t d if (ppbdev->ctx.valid) ppb_set_mode(bus, ppbdev->ctx.mode); - splx(s); + crit_exit(); return (0); } } @@ -508,7 +508,7 @@ ppb_request_bus(device_t bus, device_t d int ppb_release_bus(device_t bus, device_t dev) { - int s, error; + int error; struct ppb_data *ppb = DEVTOSOFTC(bus); struct ppb_device *ppbdev = (struct ppb_device *)device_get_ivars(dev); @@ -518,14 +518,13 @@ ppb_release_bus(device_t bus, device_t d ppbdev->intr_cookie))) return (error); - s = splhigh(); + crit_enter(); if (ppb->ppb_owner != dev) { - splx(s); + crit_exit(); return (EACCES); } - ppb->ppb_owner = 0; - splx(s); + crit_exit(); /* save the context of the device */ ppbdev->ctx.mode = ppb_get_mode(bus);