mirror of https://github.com/acidanthera/audk.git
EmbeddedPkg/SerialDxe: Only read Serial Port if data available
Poll the Serial Port to ensure data are available. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11730 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
52721ad540
commit
010bb3d2db
|
@ -188,10 +188,12 @@ SerialRead (
|
||||||
OUT VOID *Buffer
|
OUT VOID *Buffer
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINTN Count;
|
UINTN Count = 0;
|
||||||
|
|
||||||
Count = SerialPortRead (Buffer, *BufferSize);
|
if (SerialPortPoll()) {
|
||||||
*BufferSize = Count;
|
Count = SerialPortRead (Buffer, *BufferSize);
|
||||||
|
*BufferSize = Count;
|
||||||
|
}
|
||||||
return (Count == 0) ? EFI_DEVICE_ERROR : EFI_SUCCESS;
|
return (Count == 0) ? EFI_DEVICE_ERROR : EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue