29 if (SemihostConnectionSupported ()) {
47#define PRINT_BUFFER_SIZE 512
48#define PRINT_BUFFER_THRESHOLD (PRINT_BUFFER_SIZE - 4)
59 UINTN DestinationIndex;
60 UINT8 CurrentCharacter;
65 while (SourceIndex < NumberOfBytes) {
66 CurrentCharacter = Buffer[SourceIndex++];
68 switch (CurrentCharacter) {
73 PrintBuffer[DestinationIndex++] =
' ';
77 PrintBuffer[DestinationIndex++] = CurrentCharacter;
81 if (DestinationIndex > PRINT_BUFFER_THRESHOLD) {
82 PrintBuffer[DestinationIndex] =
'\0';
83 SemihostWriteString ((CHAR8 *)PrintBuffer);
89 if (DestinationIndex > 0) {
90 PrintBuffer[DestinationIndex] =
'\0';
91 SemihostWriteString ((CHAR8 *)PrintBuffer);
114 *Buffer = SemihostReadCharacter ();
132 return SemihostConnectionSupported ();
BOOLEAN EFIAPI SerialPortPoll(VOID)
#define PRINT_BUFFER_SIZE
UINTN EFIAPI SerialPortRead(OUT UINT8 *Buffer, IN UINTN NumberOfBytes)
RETURN_STATUS EFIAPI SerialPortInitialize(VOID)
UINTN EFIAPI SerialPortWrite(IN UINT8 *Buffer, IN UINTN NumberOfBytes)
#define RETURN_UNSUPPORTED