xref: /qemu/include/semihosting/console.h (revision 78e24848f6a2923f356d15d8751c644f94a39fd8)
1 /*
2  * Semihosting Console
3  *
4  * Copyright (c) 2019 Linaro Ltd
5  *
6  * SPDX-License-Identifier: GPL-2.0-or-later
7  */
8 
9 #ifndef SEMIHOST_CONSOLE_H
10 #define SEMIHOST_CONSOLE_H
11 
12 /**
13  * qemu_semihosting_console_outs:
14  * @env: CPUArchState
15  * @s: host address of null terminated guest string
16  *
17  * Send a null terminated guest string to the debug console. This may
18  * be the remote gdb session if a softmmu guest is currently being
19  * debugged.
20  *
21  * Returns: number of bytes written.
22  */
23 int qemu_semihosting_console_outs(CPUArchState *env, target_ulong s);
24 
25 /**
26  * qemu_semihosting_console_outc:
27  * @env: CPUArchState
28  * @s: host address of null terminated guest string
29  *
30  * Send single character from guest memory to the debug console. This
31  * may be the remote gdb session if a softmmu guest is currently being
32  * debugged.
33  *
34  * Returns: nothing
35  */
36 void qemu_semihosting_console_outc(CPUArchState *env, target_ulong c);
37 
38 /**
39  * qemu_semihosting_log_out:
40  * @s: pointer to string
41  * @len: length of string
42  *
43  * Send a string to the debug output. Unlike console_out these strings
44  * can't be sent to a remote gdb instance as they don't exist in guest
45  * memory.
46  *
47  * Returns: number of bytes written
48  */
49 int qemu_semihosting_log_out(const char *s, int len);
50 
51 #endif /* SEMIHOST_CONSOLE_H */
52