* <!-- description --> * @brief Writes a string to the console. * * <!-- inputs/outputs --> * @param str the string to write to the console. */
| 46 | * @param str the string to write to the console. |
| 47 | */ |
| 48 | static inline void |
| 49 | console_write(char const *const str) |
| 50 | { |
| 51 | uint64_t i = 0; |
| 52 | char buf[4] = {0}; |
| 53 | |
| 54 | /** |
| 55 | * NOTE: |
| 56 | * - We cannot simply send the string to OutputString as it is expecting |
| 57 | * a unicode string. |
| 58 | * - The minimum sized unicode string is one character (2 bytes) and a |
| 59 | * second character for the \0, which is why we have a 4 byte array. |
| 60 | * One byte to store the character we wish to print, and a second to |
| 61 | * tell OutputString to stop. |
| 62 | * - This, of course would not be needed if EFI has a character output |
| 63 | * function, which is basically what this function needs to emulate. |
| 64 | */ |
| 65 | |
| 66 | while (str[i] != '\0') { |
| 67 | buf[0] = str[i]; |
| 68 | if (g_st->ConOut->OutputString(g_st->ConOut, ((CHAR16 *)buf))) { |
| 69 | return; |
| 70 | } |
| 71 | |
| 72 | ++i; |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | static inline void |
| 77 | console_write_c(char const c) |
no outgoing calls
no test coverage detected