ArmPlatformPkg/PL011Uart: PL011UartWrite() stop to transmit if the buffer is full
Before we were waiting the buffer to be empty before to continue to send data. Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13587 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -304,10 +304,12 @@ PL011UartWrite (
|
|||||||
IN UINTN NumberOfBytes
|
IN UINTN NumberOfBytes
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINTN Count;
|
UINT8* CONST Final = &Buffer[NumberOfBytes];
|
||||||
|
|
||||||
for (Count = 0; Count < NumberOfBytes; Count++, Buffer++) {
|
while (Buffer < Final) {
|
||||||
while ((MmioRead32 (UartBase + UARTFR) & UART_TX_EMPTY_FLAG_MASK) == 0);
|
// Wait until UART able to accept another char
|
||||||
|
while ((MmioRead32 (UartBase + UARTFR) & UART_TX_FULL_FLAG_MASK));
|
||||||
|
|
||||||
MmioWrite8 (UartBase + UARTDR, *Buffer);
|
MmioWrite8 (UartBase + UARTDR, *Buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user