]> git.proxmox.com Git - mirror_edk2.git/commit
OvmfPkg: XenConsoleSerialPortLib: deal with output overflow
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 27 Mar 2015 21:25:16 +0000 (21:25 +0000)
committerlersek <lersek@Edk2>
Fri, 27 Mar 2015 21:25:16 +0000 (21:25 +0000)
commitc6d2972645187f5829cd8a3903de73710752e3f0
tree07332276588bf5bacc0b4bb0e98f4f2f4552416a
parent3a2b37f0d4d489322499110b44b6f74bbe7329d6
OvmfPkg: XenConsoleSerialPortLib: deal with output overflow

It is the responsibility of the SerialPortLib implementation
to deal with flow control if the underlying medium cannot keep
up with the inflow of data.

So in our SerialPortWrite () function, we should spin as long
as we need to in order to deliver all the data instead of giving
up and returning a smaller value than the number of bytes we were
given. Also, remove the 'if (Sent > 0)' condition on the signalling
of the event channel: if the buffer is full and we haven't been able
to add any more data, it makes perfect sense to signal the event
channel again, even if we have done so before when we did write
the data.

Also, this patch brings the implementation of XenSerialPortLib
in sync with the library class documentation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
[lersek@redhat.com: replace DebugLib dependency with open-coded ASSERT()]

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17079 6f19259b-4bc3-4df7-8a09-765794883524
OvmfPkg/Library/XenConsoleSerialPortLib/XenConsoleSerialPortLib.c