mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
sim/posix/uart: add host_printf() to debug some critical issue
Build Documentation / build-html (push) Waiting to run
Build Documentation / build-html (push) Waiting to run
Sometimes we need to bypass the system to debug some issue in critical sections Signed-off-by: chao an <anchao.archer@bytedance.com>
This commit is contained in:
@@ -32,6 +32,8 @@
|
|||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "sim_internal.h"
|
#include "sim_internal.h"
|
||||||
|
|
||||||
@@ -242,3 +244,16 @@ bool host_uart_checkout(int fd)
|
|||||||
pfd.events = POLLOUT;
|
pfd.events = POLLOUT;
|
||||||
return poll(&pfd, 1, 0) == 1;
|
return poll(&pfd, 1, 0) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: host_printf
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
void host_printf(const char *fmt, ...)
|
||||||
|
{
|
||||||
|
va_list ap;
|
||||||
|
|
||||||
|
va_start(ap, fmt);
|
||||||
|
vprintf(fmt, ap);
|
||||||
|
va_end(ap);
|
||||||
|
}
|
||||||
|
|||||||
@@ -287,6 +287,7 @@ bool host_uart_checkin(int fd);
|
|||||||
bool host_uart_checkout(int fd);
|
bool host_uart_checkout(int fd);
|
||||||
int host_uart_setcflag(int fd, unsigned int cflag);
|
int host_uart_setcflag(int fd, unsigned int cflag);
|
||||||
int host_uart_getcflag(int fd, unsigned int *cflag);
|
int host_uart_getcflag(int fd, unsigned int *cflag);
|
||||||
|
void host_printf(const char *fmt, ...);
|
||||||
|
|
||||||
/* sim_deviceimage.c ********************************************************/
|
/* sim_deviceimage.c ********************************************************/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user