MCPcopy Create free account
hub / github.com/Bareflank/hypervisor / console_write

Function console_write

loader/efi/include/debug.h:48–74  ·  view source on GitHub ↗

* <!-- description --> * @brief Writes a string to the console. * * <!-- inputs/outputs --> * @param str the string to write to the console. */

Source from the content-addressed store, hash-verified

46 * @param str the string to write to the console.
47 */
48static inline void
49console_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
76static inline void
77console_write_c(char const c)

Callers 15

platform_dump_vmmFunction · 0.85
console_write_cFunction · 0.85
bfdebugFunction · 0.85
bfdebug_x8Function · 0.85
bfdebug_x16Function · 0.85
bfdebug_x32Function · 0.85
bfdebug_x64Function · 0.85
bfdebug_d8Function · 0.85
bfdebug_d16Function · 0.85
bfdebug_d32Function · 0.85
bfdebug_d64Function · 0.85
bfdebug_ptrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected