target/xtensa: support output to chardev console
commit8128b3e0798e6c7e5742fa9f85bf8a4bf90af94a
authorMax Filippov <jcmvbkbc@gmail.com>
Fri, 12 May 2017 18:09:14 +0000 (12 11:09 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 6 Jun 2017 09:40:48 +0000 (6 02:40 -0700)
tree068e7f48cbe3422f7ff79a6ee339657bb6221f4f
parent347ec03093f9668a379ef6b7fa1feb332fff039c
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>
hw/xtensa/sim.c
target/xtensa/cpu.h
target/xtensa/xtensa-semi.c