target/xtensa: support output to chardev console
In semihosting mode QEMU allows guest to read and write host file descriptors directly, including descriptors 0..2, a.k.a. stdin, stdout and stderr. Sometimes it's desirable to have semihosting console controlled by -serial option, e.g. to connect it to network. Add semihosting console to xtensa-semi.c, open it in the 'sim' machine in the presence of -serial option and direct stdout and stderr to it when it's present. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
This commit is contained in:
1 parent
347ec03093
commit
8128b3e079
3 files changed
+57
-14
No files matched your search
@@ -114,6 +114,9 @@ static void xtensa_sim_init(MachineState *machine)
|
||||
xtensa_create_memory_regions(&sysram, "xtensa.sysram");
|
||||
}
|
||||
|
||||
if (serial_hds[0]) {
|
||||
xtensa_sim_open_console(serial_hds[0]);
|
||||
}
|
||||
if (kernel_filename) {
|
||||
uint64_t elf_entry;
|
||||
uint64_t elf_lowaddr;
|
||||
@@ -136,6 +139,7 @@ static void xtensa_sim_machine_init(MachineClass *mc)
|
||||
mc->is_default = true;
|
||||
mc->init = xtensa_sim_init;
|
||||
mc->max_cpus = 4;
|
||||
mc->no_serial = 1;
|
||||
}
|
||||
|
||||
DEFINE_MACHINE("sim", xtensa_sim_machine_init)
|
||||
Reference in new issue
Block a user