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:
oliviermartin 2011-06-03 09:14:16 +00:00
parent 52721ad540
commit 010bb3d2db
1 changed files with 5 additions and 3 deletions

View File

@ -188,10 +188,12 @@ SerialRead (
OUT VOID *Buffer
)
{
UINTN Count;
UINTN Count = 0;
if (SerialPortPoll()) {
Count = SerialPortRead (Buffer, *BufferSize);
*BufferSize = Count;
}
return (Count == 0) ? EFI_DEVICE_ERROR : EFI_SUCCESS;
}