diff options
author | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-06-03 09:14:16 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-06-03 09:14:16 +0000 |
commit | 010bb3d2dbb3d91512102ee3f3a4a160835e308a (patch) | |
tree | 33daff0e1b59b8472a5bd16604a8060857e78749 /EmbeddedPkg/SerialDxe | |
parent | 52721ad540e06d30317047f13df84547fd4214af (diff) | |
download | edk2-010bb3d2dbb3d91512102ee3f3a4a160835e308a.zip edk2-010bb3d2dbb3d91512102ee3f3a4a160835e308a.tar.gz edk2-010bb3d2dbb3d91512102ee3f3a4a160835e308a.tar.bz2 |
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/SerialDxe')
-rw-r--r-- | EmbeddedPkg/SerialDxe/SerialIo.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/EmbeddedPkg/SerialDxe/SerialIo.c b/EmbeddedPkg/SerialDxe/SerialIo.c index 612543b..b9ea4b9 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;
}
|