So how about checking both possible ports whenever the interrupt occurs?
Servicing doesn't take that long, or shouldn't on a fast machine, that the
other port will have a chance to get another character and overrun, if all you
do when you "service" the interrupt is queue the data. It can be done in a
few instructions. That way even if cua2 interrupts while you're servicing
cua0's interrupt, you'll get cua2's data in spite of missing the irq. And
cua0 doesn't have time to interrupt again in that amount of time. If
there's still a chance that data could be missed (like, cua2 interrupts
after you're done servicing it, but but before the irq line has gone high
somehow - is that even possible?) then a hybrid of this method plus polling
would fix it. The polling shouldn't need to be excessive, because you catch
most interrupts anyway, and the poll time should take into account the
size of the buffers in your 16550's - you don't even have to poll as often
as once per character if you have those.
-- _______ KB7PWD @ KC7Y.AZ.US.NOAM ecloud@goodnet.com (_ | |_) Shawn T. Rutledge on the web: http://www.goodnet.com/~ecloud __) | | \__________________________________________________________________ * electronics * Linux * techno * robotics * eschew obfuscation * Khoros *