From: Keith Packard via <qemu-devel@nongnu.org>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Keith Packard" <keithp@keithp.com>,
qemu-riscv@nongnu.org,
"Sagar Karandikar" <sagark@eecs.berkeley.edu>,
"Bastian Koppelmann" <kbastian@mail.uni-paderborn.de>,
"Laurent Vivier" <laurent@vivier.eu>,
qemu-arm@nongnu.org,
"Alistair Francis" <Alistair.Francis@wdc.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Alex Bennée" <alex.bennee@linaro.org>
Subject: [PATCH 9/9] semihosting: Implement SYS_ISERROR
Date: Mon, 14 Dec 2020 12:07:13 -0800 [thread overview]
Message-ID: <20201214200713.3886611-10-keithp@keithp.com> (raw)
In-Reply-To: <20201214200713.3886611-1-keithp@keithp.com>
Part of Semihosting for AArch32 and AArch64 Release 2.0
Signed-off-by: Keith Packard <keithp@keithp.com>
---
hw/semihosting/common-semi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/semihosting/common-semi.c b/hw/semihosting/common-semi.c
index b0648c3812..abc15bf219 100644
--- a/hw/semihosting/common-semi.c
+++ b/hw/semihosting/common-semi.c
@@ -59,6 +59,7 @@
#define TARGET_SYS_WRITE 0x05
#define TARGET_SYS_READ 0x06
#define TARGET_SYS_READC 0x07
+#define TARGET_SYS_ISERROR 0x08
#define TARGET_SYS_ISTTY 0x09
#define TARGET_SYS_SEEK 0x0a
#define TARGET_SYS_FLEN 0x0c
@@ -967,6 +968,9 @@ target_ulong do_common_semihosting(CPUState *cs)
return guestfd_fns[gf->type].readfn(cs, gf, arg1, len);
case TARGET_SYS_READC:
return qemu_semihosting_console_inc(cs->env_ptr);
+ case TARGET_SYS_ISERROR:
+ GET_ARG(0);
+ return (target_long) arg0 < 0 ? 1 : 0;
case TARGET_SYS_ISTTY:
GET_ARG(0);
--
2.29.2
next prev parent reply other threads:[~2020-12-14 20:18 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-25 21:36 [PATCH 0/8] Add RISC-V semihosting 0.2. Finish ARM semihosting 2.0 Keith Packard via
2020-11-25 21:36 ` [PATCH 1/8] semihosting: Move ARM semihosting code to shared directories [v3] Keith Packard via
2020-11-25 21:36 ` [PATCH 2/8] semihosting: Change common-semi API to be architecture-independent Keith Packard via
2020-11-25 21:36 ` [PATCH 3/8] semihosting: Change internal common-semi interfaces to use CPUState * [v2] Keith Packard via
2020-11-25 21:36 ` [PATCH 4/8] semihosting: Support SYS_HEAPINFO when env->boot_info is not set Keith Packard via
2020-11-25 21:36 ` [PATCH 5/8] riscv: Add semihosting support [v13] Keith Packard via
2020-12-09 7:58 ` Kito Cheng
2020-12-09 16:29 ` Keith Packard via
2020-12-10 3:39 ` Kito Cheng
2020-12-10 6:21 ` Keith Packard via
2020-12-14 11:29 ` Alex Bennée
2020-11-25 21:36 ` [PATCH 6/8] semihosting: Implement SYS_ELAPSED and SYS_TICKFREQ Keith Packard via
2020-11-25 21:36 ` [PATCH 7/8] semihosting: Implement SYS_TMPNAM Keith Packard via
2020-11-25 21:36 ` [PATCH 8/8] semihosting: Implement SYS_ISERROR Keith Packard via
2020-12-14 11:24 ` [PATCH 0/8] Add RISC-V semihosting 0.2. Finish ARM semihosting 2.0 Alex Bennée
2020-12-14 14:58 ` Alex Bennée
2020-12-14 20:06 ` Keith Packard via
2020-12-14 20:07 ` [PATCH 0/9] " Keith Packard via
2020-12-14 20:07 ` [PATCH 1/9] semihosting: Move ARM semihosting code to shared directories Keith Packard via
2020-12-14 20:07 ` [PATCH 2/9] semihosting: Change common-semi API to be architecture-independent Keith Packard via
2020-12-14 20:07 ` [PATCH 3/9] semihosting: Change internal common-semi interfaces to use CPUState * Keith Packard via
2020-12-14 20:07 ` [PATCH 4/9] semihosting: Support SYS_HEAPINFO when env->boot_info is not set Keith Packard via
2020-12-14 20:07 ` [PATCH 5/9] riscv: Add semihosting support Keith Packard via
2020-12-14 20:07 ` [PATCH 6/9] riscv: Add semihosting support for user mode Keith Packard via
2020-12-14 20:07 ` [PATCH 7/9] semihosting: Implement SYS_ELAPSED and SYS_TICKFREQ Keith Packard via
2020-12-14 20:07 ` [PATCH 8/9] semihosting: Implement SYS_TMPNAM Keith Packard via
2020-12-14 20:07 ` Keith Packard via [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-01-07 17:07 [PATCH 0/9] Add RISC-V semihosting 0.2. Finish ARM semihosting 2.0 Keith Packard via
2021-01-07 17:07 ` [PATCH 9/9] semihosting: Implement SYS_ISERROR Keith Packard via
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201214200713.3886611-10-keithp@keithp.com \
--to=qemu-devel@nongnu.org \
--cc=Alistair.Francis@wdc.com \
--cc=alex.bennee@linaro.org \
--cc=kbastian@mail.uni-paderborn.de \
--cc=keithp@keithp.com \
--cc=laurent@vivier.eu \
--cc=palmer@dabbelt.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=sagark@eecs.berkeley.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).