diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2000-04-02 23:32:14 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2000-04-02 23:32:14 +0000 |
commit | a7f429e1b3f8b346b2ad176de625c11889edb495 (patch) | |
tree | 2ff192e59e79db75ee32defd40cf354f82684db6 | |
parent | 03f34fa8e39d66a9dd84b61798afa1755d22adc0 (diff) |
AdvSendIdleCmd() not re-entrant - use splbio()/splx(). Two typos.
-rw-r--r-- | sys/dev/ic/adwlib.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/ic/adwlib.c b/sys/dev/ic/adwlib.c index e0ce2b8fe15..67d3d8f61f7 100644 --- a/sys/dev/ic/adwlib.c +++ b/sys/dev/ic/adwlib.c @@ -99,7 +99,7 @@ static void AdvDelayMicroSecond __P((u_int32_t)); * * All drivers should use this structure to set the default EEPROM * configuration. The BIOS now uses this structure when it is built. - * Additional structure information can be found in advlib.h where + * Additional structure information can be found in adwlib.h where * the structure is defined. */ static ADW_EEP_3550_CONFIG @@ -2303,7 +2303,7 @@ ADW_SOFTC *sc; * Command completion is polled for once per microsecond. * * The function can be called from anywhere including an interrupt handler. - * But the function is not re-entrant, so it uses the DvcEnter/LeaveCritical() + * But the function is not re-entrant, so it uses the splbio/splx() * functions to prevent reentrancy. * * Return Values: @@ -2320,8 +2320,9 @@ u_int32_t idle_cmd_parameter; bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; int result; - u_int32_t i, j; - + u_int32_t s, i, j; + + s = splbio(); /* * Clear the idle command status which is set by the microcode @@ -2360,12 +2361,14 @@ u_int32_t idle_cmd_parameter; for (j = 0; j < SCSI_US_PER_MSEC; j++) { ADW_READ_WORD_LRAM(iot, ioh, ASC_MC_IDLE_CMD_STATUS, result); if (result != 0) { + splx(s); return result; } AdvDelayMicroSecond(1); } } + splx(s); return ADW_ERROR; } |