pc_serial: break instead of continue in irq handler
We don't want to busy loop, do we?
This commit is contained in:
@@ -408,7 +408,7 @@ SerialDevice::InterruptHandler()
|
|||||||
fifoavail = 64;
|
fifoavail = 64;
|
||||||
// we're not open... just discard the data
|
// we're not open... just discard the data
|
||||||
if (!IsOpen())
|
if (!IsOpen())
|
||||||
continue;
|
break;
|
||||||
gTTYModule->tty_control(fDeviceTTYCookie, FIONREAD, &readable,
|
gTTYModule->tty_control(fDeviceTTYCookie, FIONREAD, &readable,
|
||||||
sizeof(readable));
|
sizeof(readable));
|
||||||
TRACE("%s: FIONREAD: %d\n", __FUNCTION__, readable);
|
TRACE("%s: FIONREAD: %d\n", __FUNCTION__, readable);
|
||||||
@@ -420,7 +420,7 @@ SerialDevice::InterruptHandler()
|
|||||||
TRACE("%s: tty_read: %d\n", __FUNCTION__, bytesLeft);
|
TRACE("%s: tty_read: %d\n", __FUNCTION__, bytesLeft);
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
dprintf(DRIVER_NAME ": irq: tty_read: %s\n", strerror(status));
|
dprintf(DRIVER_NAME ": irq: tty_read: %s\n", strerror(status));
|
||||||
continue;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < bytesLeft; i++) {
|
for (i = 0; i < bytesLeft; i++) {
|
||||||
@@ -440,12 +440,12 @@ SerialDevice::InterruptHandler()
|
|||||||
}
|
}
|
||||||
// we're not open... just discard the data
|
// we're not open... just discard the data
|
||||||
if (!IsOpen())
|
if (!IsOpen())
|
||||||
continue;
|
break;
|
||||||
// we shouldn't block here but it's < 256 bytes anyway
|
// we shouldn't block here but it's < 256 bytes anyway
|
||||||
status = gTTYModule->tty_write(fDeviceTTYCookie, buffer, &i);
|
status = gTTYModule->tty_write(fDeviceTTYCookie, buffer, &i);
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
dprintf(DRIVER_NAME ": irq: tty_write: %s\n", strerror(status));
|
dprintf(DRIVER_NAME ": irq: tty_write: %s\n", strerror(status));
|
||||||
continue;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case IIR_RLS:
|
case IIR_RLS:
|
||||||
@@ -459,7 +459,7 @@ SerialDevice::InterruptHandler()
|
|||||||
// modem signals changed
|
// modem signals changed
|
||||||
msr = ReadReg8(MSR);
|
msr = ReadReg8(MSR);
|
||||||
if (!IsOpen())
|
if (!IsOpen())
|
||||||
continue;
|
break;
|
||||||
if (msr & MSR_DDCD)
|
if (msr & MSR_DDCD)
|
||||||
SignalControlLineState(TTYHWDCD, msr & MSR_DCD);
|
SignalControlLineState(TTYHWDCD, msr & MSR_DCD);
|
||||||
if (msr & MSR_DCTS)
|
if (msr & MSR_DCTS)
|
||||||
|
|||||||
Reference in New Issue
Block a user