From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48746) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5tEW-0002qX-S9 for qemu-devel@nongnu.org; Fri, 19 Jun 2015 06:09:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5tES-0002m7-4O for qemu-devel@nongnu.org; Fri, 19 Jun 2015 06:09:12 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:22747) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5tER-0002lm-TZ for qemu-devel@nongnu.org; Fri, 19 Jun 2015 06:09:08 -0400 From: Leon Alrae Date: Fri, 19 Jun 2015 11:08:39 +0100 Message-ID: <1434708524-25434-1-git-send-email-leon.alrae@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PATCH v3 0/5] target-mips: add UHI semihosting support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: matthew.fortune@imgtec.com, aurelien@aurel32.net 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 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