mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-03 20:04:23 +02:00
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:
parent
93b429fc21
commit
ebef1b7421
@ -304,10 +304,12 @@ PL011UartWrite (
|
|||||||
IN UINTN NumberOfBytes
|
IN UINTN NumberOfBytes
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
UINTN Count;
|
UINT8* CONST Final = &Buffer[NumberOfBytes];
|
||||||
|
|
||||||
|
while (Buffer < Final) {
|
||||||
|
// Wait until UART able to accept another char
|
||||||
|
while ((MmioRead32 (UartBase + UARTFR) & UART_TX_FULL_FLAG_MASK));
|
||||||
|
|
||||||
for (Count = 0; Count < NumberOfBytes; Count++, Buffer++) {
|
|
||||||
while ((MmioRead32 (UartBase + UARTFR) & UART_TX_EMPTY_FLAG_MASK) == 0);
|
|
||||||
MmioWrite8 (UartBase + UARTDR, *Buffer);
|
MmioWrite8 (UartBase + UARTDR, *Buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user