This series introduces the Unified Hosting Interface support to QEMU. Version 3 of this patchset contains just minor cleanup and corrections in mips-semi.c comparing to previous version.
It has been on the mailing list for a while and given that command line option responsible for passing semihosting arguments is clarified I'm planning to apply this patch series to mips-next soon. Patches apply on top of: https://lists.gnu.org/archive/html/qemu-devel/2015-06/msg05013.html Simple example for those who would like to give it a try: Bare Metal Toolchain containing UHI support can be obtained from: http://codescape-mips-sdk.imgtec.com/components/toolchain/2015.01-7/ * Source file: #include <stdio.h> int main(int argc, char *argv[]) { int i; for (i = 0; i < argc; i++) { printf("argv[%d] = %s\n", i, argv[i]); } return 0; } * Build: $ mips-img-elf-gcc -mips64r6 -mabi=64 -EL -Tuhi64_64.ld main.c * Run $ qemu-system-mips64el -cpu mips64r6-generic -M malta -nographic -kernel a.out -semihosting-config arg=a.out,arg=foo,arg="bar baz" argv[0] = a.out argv[1] = foo argv[2] = bar baz Regards, Leon v3: * remove useless #ifndef CONFIG_USER_ONLY * correct errno in copy_stat_to_target(), write_to_file() and read_from_file() v2: * use new -semihosting arg option * if semihosting args are not present, then fall back to old-style -kernel/-append * clean up SDBBP and remove identical code in different branch * fix overlooked microMIPS SDBBP * translate errno values which don't map 1:1 * update dates in the licence header * return -1 and fake errno when lock_user() fails in write_to_file() and read_from_file() Leon Alrae (3): target-mips: remove identical code in different branch target-mips: add Unified Hosting Interface (UHI) support target-mips: convert host to MIPS errno values when required Maciej W. Rozycki (1): include/softmmu-semi.h: Make semihosting support 64-bit clean Matthew Fortune (1): hw/mips: Do not clear BEV for MIPS malta kernel load hw/mips/mips_malta.c | 11 +- include/exec/softmmu-semi.h | 13 +- qemu-options.hx | 10 +- target-mips/Makefile.objs | 2 +- target-mips/helper.h | 2 + target-mips/mips-semi.c | 358 ++++++++++++++++++++++++++++++++++++++++++++ target-mips/translate.c | 68 +++++---- 7 files changed, 426 insertions(+), 38 deletions(-) create mode 100644 target-mips/mips-semi.c