summaryrefslogtreecommitdiffstats
path: root/EmbeddedPkg
diff options
context:
space:
mode:
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-03 09:14:16 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2011-06-03 09:14:16 +0000
commit010bb3d2dbb3d91512102ee3f3a4a160835e308a (patch)
tree33daff0e1b59b8472a5bd16604a8060857e78749 /EmbeddedPkg
parent52721ad540e06d30317047f13df84547fd4214af (diff)
downloadedk2-010bb3d2dbb3d91512102ee3f3a4a160835e308a.tar.gz
edk2-010bb3d2dbb3d91512102ee3f3a4a160835e308a.tar.bz2
edk2-010bb3d2dbb3d91512102ee3f3a4a160835e308a.zip
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
Diffstat (limited to 'EmbeddedPkg')
-rw-r--r--EmbeddedPkg/SerialDxe/SerialIo.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/EmbeddedPkg/SerialDxe/SerialIo.c b/EmbeddedPkg/SerialDxe/SerialIo.c
index 612543be14..b9ea4b9c42 100644
--- a/EmbeddedPkg/SerialDxe/SerialIo.c
+++ b/EmbeddedPkg/SerialDxe/SerialIo.c
@@ -188,10 +188,12 @@ SerialRead (
OUT VOID *Buffer
)
{
- UINTN Count;
+ UINTN Count = 0;
- Count = SerialPortRead (Buffer, *BufferSize);
- *BufferSize = Count;
+ if (SerialPortPoll()) {
+ Count = SerialPortRead (Buffer, *BufferSize);
+ *BufferSize = Count;
+ }
return (Count == 0) ? EFI_DEVICE_ERROR : EFI_SUCCESS;
}