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:
oliviermartin 2012-08-02 14:22:51 +00:00
parent 93b429fc21
commit ebef1b7421
1 changed files with 5 additions and 3 deletions

View File

@ -304,10 +304,12 @@ PL011UartWrite (
IN UINTN NumberOfBytes
)
{
UINTN Count;
UINT8* CONST Final = &Buffer[NumberOfBytes];
for (Count = 0; Count < NumberOfBytes; Count++, Buffer++) {
while ((MmioRead32 (UartBase + UARTFR) & UART_TX_EMPTY_FLAG_MASK) == 0);
while (Buffer < Final) {
// Wait until UART able to accept another char
while ((MmioRead32 (UartBase + UARTFR) & UART_TX_FULL_FLAG_MASK));
MmioWrite8 (UartBase + UARTDR, *Buffer);
}