1 /*
2  * Copyright (c) 2008-2014 Travis Geiselbrecht
3  *
4  * Use of this source code is governed by a MIT-style
5  * license that can be found in the LICENSE file or at
6  * https://opensource.org/licenses/MIT
7  */
8 #include <lk/reg.h>
9 #include <stdio.h>
10 #include <kernel/thread.h>
11 #include <dev/uart.h>
12 #include <platform/debug.h>
13 #include <target/debugconfig.h>
14 #include <lk/reg.h>
15 
platform_dputc(char c)16 void platform_dputc(char c) {
17     if (c == '\n')
18         uart_putc(DEBUG_UART, '\r');
19     uart_putc(DEBUG_UART, c);
20 }
21 
platform_dgetc(char * c,bool wait)22 int platform_dgetc(char *c, bool wait) {
23     int ret = uart_getc(DEBUG_UART, wait);
24     if (ret == -1)
25         return -1;
26     *c = ret;
27     return 0;
28 }
29