| 74 | } |
| 75 | |
| 76 | static inline void |
| 77 | console_write_c(char const c) |
| 78 | { |
| 79 | char buf[4] = {0}; |
| 80 | |
| 81 | if (c == '\n') { |
| 82 | console_write("\r\n"); |
| 83 | return; |
| 84 | } |
| 85 | |
| 86 | if (c == '\r') { |
| 87 | return; |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * NOTE: |
| 92 | * - We cannot simply send the string to OutputString as it is expecting |
| 93 | * a unicode string. |
| 94 | * - The minimum sized unicode string is one character (2 bytes) and a |
| 95 | * second character for the \0, which is why we have a 4 byte array. |
| 96 | * One byte to store the character we wish to print, and a second to |
| 97 | * tell OutputString to stop. |
| 98 | * - This, of course would not be needed if EFI has a character output |
| 99 | * function, which is basically what this function needs to emulate. |
| 100 | */ |
| 101 | |
| 102 | buf[0] = c; |
| 103 | g_st->ConOut->OutputString(g_st->ConOut, ((CHAR16 *)buf)); |
| 104 | } |
| 105 | |
| 106 | /** |
| 107 | * <!-- description --> |
no test coverage detected