Modify debug output system to allow for two destinations

Signed-off-by: Eugene D Myers <cedarhouse@comcast.net>
This commit is contained in:
Eugene D Myers 2020-06-19 16:45:33 -04:00
parent 6d2d68bc37
commit 0d14bc42ea
2 changed files with 26 additions and 7 deletions

View File

@ -55,6 +55,12 @@ SerialPortWrite (
IN UINT8 *Buffer,
IN UINTN NumberOfBytes
);
UINTN
EFIAPI
SerialPortWriteSingle(
IN UINT8 Buffer
);
/**
@ -73,6 +79,7 @@ SerialPortWrite (
@retval >0 Actual number of bytes read from serial device.
**/
UINTN
EFIAPI
SerialPortRead (

View File

@ -142,17 +142,29 @@ SerialPortWrite (
Result = NumberOfBytes;
while (NumberOfBytes--) {
//
// Wait for the serail port to be ready.
//
do {
Data = IoRead8 ((UINT16) gUartBase + LSR_OFFSET);
} while ((Data & LSR_TXRDY) == 0);
IoWrite8 ((UINT16) gUartBase, *Buffer++);
SerialPortWriteSingle(*Buffer++);
}
return Result;
}
UINTN
EFIAPI
SerialPortWriteSingle(
IN UINT8 Buffer
)
{
UINT8 Data;
//
// Wait for the serail port to be ready.
//
do {
Data = IoRead8 ((UINT16) gUartBase + LSR_OFFSET);
} while ((Data & LSR_TXRDY) == 0);
IoWrite8 ((UINT16) gUartBase, Buffer);
return 0;
}
/**