Commit 100b667 1 parent d46197e commit 100b667 Copy full SHA for 100b667
File tree 1 file changed +24
-19
lines changed
ArmPlatformPkg/Library/PL011UartLib
1 file changed +24
-19
lines changed Original file line number Diff line number Diff line change @@ -435,6 +435,24 @@ PL011UartWrite (
435
435
return NumberOfBytes ;
436
436
}
437
437
438
+ // MU_CHANGE Starts: Do not wait indefinitely for the receive buffer to get filled.
439
+
440
+ /**
441
+ Check to see if any data is available to be read from the debug device.
442
+
443
+ @retval TRUE At least one byte of data is available to be read
444
+ @retval FALSE No data is available to be read
445
+
446
+ **/
447
+ BOOLEAN
448
+ EFIAPI
449
+ PL011UartPoll (
450
+ IN UINTN UartBase
451
+ )
452
+ {
453
+ return ((MmioRead32 (UartBase + UARTFR ) & UART_RX_EMPTY_FLAG_MASK ) == 0 );
454
+ }
455
+
438
456
/**
439
457
Read data from serial device and save the data in buffer.
440
458
@@ -455,28 +473,15 @@ PL011UartRead (
455
473
{
456
474
UINTN Count ;
457
475
458
- for (Count = 0 ; Count < NumberOfBytes ; Count ++ , Buffer ++ ) {
459
- while ((MmioRead32 (UartBase + UARTFR ) & UART_RX_EMPTY_FLAG_MASK ) != 0 ) {
460
- }
476
+ // for (Count = 0; Count < NumberOfBytes; Count++, Buffer++) {
477
+ // while ((MmioRead32 (UartBase + UARTFR) & UART_RX_EMPTY_FLAG_MASK) != 0) {
478
+ // }
461
479
480
+ for (Count = 0 ; (Count < NumberOfBytes ) && PL011UartPoll (UartBase ); Count ++ , Buffer ++ ) {
462
481
* Buffer = MmioRead8 (UartBase + UARTDR );
463
482
}
464
483
465
- return NumberOfBytes ;
466
- }
467
-
468
- /**
469
- Check to see if any data is available to be read from the debug device.
470
-
471
- @retval TRUE At least one byte of data is available to be read
472
- @retval FALSE No data is available to be read
484
+ return Count ;
473
485
474
- **/
475
- BOOLEAN
476
- EFIAPI
477
- PL011UartPoll (
478
- IN UINTN UartBase
479
- )
480
- {
481
- return ((MmioRead32 (UartBase + UARTFR ) & UART_RX_EMPTY_FLAG_MASK ) == 0 );
486
+ // MU_CHANGE Ends
482
487
}
You can’t perform that action at this time.
0 commit comments