Message ID | 20220503194843.1379101-11-richard.henderson@linaro.org |
---|---|
State | Superseded |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp9779431map; Tue, 3 May 2022 13:04:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKGgwCE+MPFbUnFrpUXLqNVZOOOMFLJBL4tbXEX4C+uhHY53Dx3u9ObFQRIvjSZeHB3ONn X-Received: by 2002:ac8:5b51:0:b0:2f3:8654:53b2 with SMTP id n17-20020ac85b51000000b002f3865453b2mr16430305qtw.300.1651608299401; Tue, 03 May 2022 13:04:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651608299; cv=none; d=google.com; s=arc-20160816; b=Mq+aFylrxeUoihCJc58kHtx1AWuyDukUEEqEGJlVcWrDmBYxYRbbI7TE8uQok5H/k+ 6/qp0ib7pF206EouKH2cK6npkzqTQ/CYLn65X0DnYZJF9/A8LrEnkHYHj2iy5ICKnwBB HT70sHogr83wXzwjwmULGwwVPrATcUY9ImUTggEf4ehV+zv/SNzPbKnvLGYzZD6cQc4a F8ssSSvLILq64gesoQUsOs9FQvQIwXSz/0WSTQ0pdtAIvMCkPu4wNMZ2nReYHwlx3g4W gJ3/QEUkTozkQsGuj84LF6nX6uuJUZTCnQecN5AXXqedO+PHsd8++szalTLGv3Pj+6EB tWLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=D4UV//9Dx1fKTWaO/CeFVHK/oLn3ZgWAg/jUv9V5umM=; b=y+VwtVD4IukizXKgcBoqGEK4F/YLqNw+jGd14SBDsZkCBSZkCr/WgKAGIQ57V3pJL/ 0mT7pRkDObshozhCF4zQTZf+qCwkYz8QND7e/eOiCYmwVrNkcsEe1/I+VXE8IRY9YD8Z zmnPM+0k+jYw7wLJwReatMxNjzrmFNSs9Ecv1k0/ywRZJaXuCPn8gnuw6FMj51Fin0MP qLkyARIj89OFFxKJqZhQaCKZwIqr00Ha52G47xHS4u4CrNjaPilJkE6/uAGzD2dRKiHI OPUNGZ7R2rBWfk6TfhQ/PwHQmbC8KhugNLfLqyaTiShxAEp60Tn+p359cRsVQFSEhQ1L UWkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W+M7sOnW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m126-20020a378a84000000b0067e4be2384asi7956241qkd.143.2022.05.03.13.04.59 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 May 2022 13:04:59 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W+M7sOnW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:48034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+patch=linaro.org@nongnu.org>) id 1nlylW-00053H-Ts for patch@linaro.org; Tue, 03 May 2022 16:04:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1nlyW7-0001Nl-G3 for qemu-devel@nongnu.org; Tue, 03 May 2022 15:49:03 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:39542) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <richard.henderson@linaro.org>) id 1nlyW4-0003Wq-7p for qemu-devel@nongnu.org; Tue, 03 May 2022 15:49:03 -0400 Received: by mail-pj1-x102a.google.com with SMTP id a15-20020a17090ad80f00b001dc2e23ad84so3204444pjv.4 for <qemu-devel@nongnu.org>; Tue, 03 May 2022 12:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=D4UV//9Dx1fKTWaO/CeFVHK/oLn3ZgWAg/jUv9V5umM=; b=W+M7sOnWKH4+sz4oIHDL1NUrIdYlxisX00NL5wkyu1dO0mGxe2R3gBQRXA7T/n4yEl mtdZ9gvLlurO0axgbzgE8MayT6SITdDzKoa7XoZfDJBw4qQBTUrEoC/XpBZ7HKUeW7kN C7/k1tOzJDDE/nXo2aL+hOzfxc0YggsvQscNaYlpifl9C9+8dnrCOM7dw/UO3XZtU+i5 OJZF2rvyA9wHNccWgVOazhau1i1OmZsw4xlMkpHJEuRGj0vKLhtON4tF7o4zR5YBgEpv hxJTEvi8JQdZmAzmvkDqX9RMKwHC1mp02hp1cTylinevt3GpeM0kVY/fQriZqM7YvcOF OASw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=D4UV//9Dx1fKTWaO/CeFVHK/oLn3ZgWAg/jUv9V5umM=; b=CPiGVyYAMnfxYqoV2GQ84sTWZmBmtFBl+HFOW4yxQmoLqTFxseEo7p1UNSravDAnZD hE4r1R9Z8KEw9se3E3PpHYybzSVqtB++gum4AwC9/WkmHOX/XljBby54JTLu1pLm9SpX Jh9sUlW+jMDJMRp6lPE6+Lx9I4a0FuTs8NU1qFegj3aEYFMgfYNq1NFU7e6KOkQgtB9H PS4BE4x4KaLbZ7/mObVyiZCHYFxJTnL8Te4rqZL27enI4Db/8NJOoogESmjRsmx3ngw9 X5cPuv7xCNmUbOEO03pLBjW9vzLtkOTA4SO1jBhIQlp8jmjwiC5J4V4/izB2jaNrehsT 0l9w== X-Gm-Message-State: AOAM530/HQ5EECmukAWem8i6N2ebdnXkBfFzJaJZtYFXDJAGrbvROJkg l7awsyyrR/AoetR8TYGcfFpqJ99kZGl71g== X-Received: by 2002:a17:902:eb85:b0:15e:bf29:bd9f with SMTP id q5-20020a170902eb8500b0015ebf29bd9fmr2104357plg.135.1651607335759; Tue, 03 May 2022 12:48:55 -0700 (PDT) Received: from stoup.. ([71.212.142.129]) by smtp.gmail.com with ESMTPSA id p11-20020a17090ad30b00b001cd4989fed3sm1712383pju.31.2022.05.03.12.48.55 for <qemu-devel@nongnu.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 May 2022 12:48:55 -0700 (PDT) From: Richard Henderson <richard.henderson@linaro.org> To: qemu-devel@nongnu.org Subject: [PATCH v2 10/74] semihosting: Adjust error checking in common_semi_cb Date: Tue, 3 May 2022 12:47:39 -0700 Message-Id: <20220503194843.1379101-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220503194843.1379101-1-richard.henderson@linaro.org> References: <20220503194843.1379101-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102a.google.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patch=linaro.org@nongnu.org> |
Series |
semihosting cleanup
|
expand
|
diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index 7030dfd587..18664b1c47 100644 --- a/semihosting/arm-compat-semi.c +++ b/semihosting/arm-compat-semi.c @@ -276,7 +276,7 @@ static target_ulong common_semi_syscall_len; static void common_semi_cb(CPUState *cs, target_ulong ret, target_ulong err) { - if (ret == (target_ulong)-1) { + if (err) { #ifdef CONFIG_USER_ONLY TaskState *ts = cs->opaque; ts->swi_errno = err;
The err parameter is non-zero if and only if an error occured. Use this instead of ret == -1 for determining if we need to update the saved errno. This fixes the errno setting of SYS_ISTTY, which returns 0 on error, not -1. Signed-off-by: Richard Henderson <richard.henderson@linaro.org> --- semihosting/arm-compat-semi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)