From patchwork Thu Jan 7 17:07:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Packard X-Patchwork-Id: 12004533 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26019C433DB for ; Thu, 7 Jan 2021 17:19:24 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CCBFA2311E for ; Thu, 7 Jan 2021 17:19:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CCBFA2311E Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=nongnu.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kxYwU-0006pb-T0 for qemu-devel@archiver.kernel.org; Thu, 07 Jan 2021 12:19:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:48370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxYrL-0000qa-HK; Thu, 07 Jan 2021 12:14:03 -0500 Received: from home.keithp.com ([63.227.221.253]:55580 helo=elaine.keithp.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxYrG-0001cb-6h; Thu, 07 Jan 2021 12:14:03 -0500 Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id 5F4A73F2E377; Thu, 7 Jan 2021 09:07:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=keithp.com; s=mail; t=1610039248; bh=ao8BkiJUDNltJDG+znPk84V3JVHLPOPySPB5Z6oOHPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qln/jqfqzdkN5UkA4Tazx5hFW9ILpQ3FiHixTYXWoPgicwLoX60GNyr9/yTephVEp X5sL1Ggkbk1YnY7o2g0r8qX1F58bdCTKENW4nYxpnjgGziR6yWpXQFJjyuGqnlnDW1 kGjqBZQtciu9s8Y3vnsetu0MBlN/lu9Ljg5Tgjw0aooyuVdOl6HbSTdO3dQ1SW/aGi 0x1/FL4upVKNzLlIWgui3hown/sZwxi5w8tPvwl1eM5P+czxFdXkY1HUeTBG8dDthm 0eLQxpqd7Sb+vntjZYdGxMM3CVBqzhJ+pnRGWp0L5ti3tm0WppbUERh7xP+q98/ne7 J1MgTICQ+Dkdg== X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from elaine.keithp.com ([127.0.0.1]) by localhost (elaine.keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id XOUfMGZHfuGL; Thu, 7 Jan 2021 09:07:28 -0800 (PST) Received: from vr.keithp.com (vr.keithp.com [10.0.0.39]) by elaine.keithp.com (Postfix) with ESMTP id 49C3F3F2E398; Thu, 7 Jan 2021 09:07:24 -0800 (PST) Received: by vr.keithp.com (Postfix, from userid 1000) id 3DF96742C6B; Thu, 7 Jan 2021 09:07:24 -0800 (PST) To: qemu-devel@nongnu.org Subject: [PATCH 9/9] semihosting: Implement SYS_ISERROR Date: Thu, 7 Jan 2021 09:07:17 -0800 Message-Id: <20210107170717.2098982-10-keithp@keithp.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210107170717.2098982-1-keithp@keithp.com> References: <20210107170717.2098982-1-keithp@keithp.com> MIME-Version: 1.0 Received-SPF: none client-ip=63.227.221.253; envelope-from=keithp@vr.keithp.com; helo=elaine.keithp.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Keith Packard , qemu-riscv@nongnu.org, Sagar Karandikar , Bastian Koppelmann , Laurent Vivier , qemu-arm@nongnu.org, Alistair Francis , Palmer Dabbelt , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reply-to: Keith Packard X-Patchwork-Original-From: Keith Packard via From: Keith Packard Part of Semihosting for AArch32 and AArch64 Release 2.0 Signed-off-by: Keith Packard Message-Id: <20201214200713.3886611-10-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);