mirror of https://github.com/acidanthera/audk.git
Check the serial buffer empty status before performing the serial IO reading operation.
Signed-off-by: niruiyu Reviewed-by: vanjeff git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12581 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
bdfbe63efa
commit
59d88f42ca
|
@ -515,6 +515,7 @@ TerminalConInTimerHandler (
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
TERMINAL_DEV *TerminalDevice;
|
TERMINAL_DEV *TerminalDevice;
|
||||||
|
UINT32 Control;
|
||||||
UINT8 Input;
|
UINT8 Input;
|
||||||
EFI_SERIAL_IO_MODE *Mode;
|
EFI_SERIAL_IO_MODE *Mode;
|
||||||
EFI_SERIAL_IO_PROTOCOL *SerialIo;
|
EFI_SERIAL_IO_PROTOCOL *SerialIo;
|
||||||
|
@ -558,7 +559,12 @@ TerminalConInTimerHandler (
|
||||||
TerminalDevice->SerialInTimeOut = SerialInTimeOut;
|
TerminalDevice->SerialInTimeOut = SerialInTimeOut;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
// Check whether serial buffer is empty.
|
||||||
|
//
|
||||||
|
Status = SerialIo->GetControl (SerialIo, &Control);
|
||||||
|
|
||||||
|
if ((Control & EFI_SERIAL_INPUT_BUFFER_EMPTY) == 0) {
|
||||||
//
|
//
|
||||||
// Fetch all the keys in the serial buffer,
|
// Fetch all the keys in the serial buffer,
|
||||||
// and insert the byte stream into RawFIFO.
|
// and insert the byte stream into RawFIFO.
|
||||||
|
@ -580,6 +586,7 @@ TerminalConInTimerHandler (
|
||||||
|
|
||||||
RawFiFoInsertOneKey (TerminalDevice, Input);
|
RawFiFoInsertOneKey (TerminalDevice, Input);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Translate all the raw data in RawFIFO into EFI Key,
|
// Translate all the raw data in RawFIFO into EFI Key,
|
||||||
|
|
Loading…
Reference in New Issue