Commit 0b189b6ce1738971f2fb7d84860b9bf0f9a1e87b
Committed by
Tom Rini
1 parent
bd1e3bcc0b
Exists in
smarc_8mq_lf_v2020.04
and in
17 other branches
Revert "sandbox: remove os_putc() and os_puts()"
While sandbox works OK without the special-case code, it does result in console output being stored in the pre-console buffer while sandbox starts up. If there is a crash or a problem then there is no indication of what is going on. For ease of debugging it seems better to revert this change. This reverts commit 47b98ad0f6779485d0f0c14f337c3eece273eb54. Signed-off-by: Simon Glass <sjg@chromium.org>
Showing 2 changed files with 31 additions and 0 deletions Side-by-side Diff
arch/sandbox/cpu/os.c
... | ... | @@ -421,6 +421,17 @@ |
421 | 421 | return 0; |
422 | 422 | } |
423 | 423 | |
424 | +void os_putc(int ch) | |
425 | +{ | |
426 | + putchar(ch); | |
427 | +} | |
428 | + | |
429 | +void os_puts(const char *str) | |
430 | +{ | |
431 | + while (*str) | |
432 | + os_putc(*str++); | |
433 | +} | |
434 | + | |
424 | 435 | int os_write_ram_buf(const char *fname) |
425 | 436 | { |
426 | 437 | struct sandbox_state *state = state_get_current(); |
include/os.h
... | ... | @@ -241,6 +241,26 @@ |
241 | 241 | int os_get_filesize(const char *fname, loff_t *size); |
242 | 242 | |
243 | 243 | /** |
244 | + * Write a character to the controlling OS terminal | |
245 | + * | |
246 | + * This bypasses the U-Boot console support and writes directly to the OS | |
247 | + * stdout file descriptor. | |
248 | + * | |
249 | + * @param ch Character to write | |
250 | + */ | |
251 | +void os_putc(int ch); | |
252 | + | |
253 | +/** | |
254 | + * Write a string to the controlling OS terminal | |
255 | + * | |
256 | + * This bypasses the U-Boot console support and writes directly to the OS | |
257 | + * stdout file descriptor. | |
258 | + * | |
259 | + * @param str String to write (note that \n is not appended) | |
260 | + */ | |
261 | +void os_puts(const char *str); | |
262 | + | |
263 | +/** | |
244 | 264 | * Write the sandbox RAM buffer to a existing file |
245 | 265 | * |
246 | 266 | * @param fname Filename to write memory to (simple binary format) |