From patchwork Thu Feb 16 05:45:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 654009 Delivered-To: patch@linaro.org Received: by 2002:adf:f90f:0:0:0:0:0 with SMTP id b15csp177865wrr; Wed, 15 Feb 2023 21:48:04 -0800 (PST) X-Google-Smtp-Source: AK7set8P9PL6zNLT4aFOquXX+aRSaIwVOuHyDrIQQgVW+LevtabIpCeG98N9BDnNcCKalIhkFf2C X-Received: by 2002:a05:6214:300c:b0:56e:bff1:83a7 with SMTP id ke12-20020a056214300c00b0056ebff183a7mr8684966qvb.18.1676526484078; Wed, 15 Feb 2023 21:48:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676526484; cv=none; d=google.com; s=arc-20160816; b=1B6bzidwXJzMQWDRpmFZ4Hib1WIFjOflXDyBlHe+QUxi345JnEMP9Hkufo0hxaRXCU I/HYy0GLrWsI5vHQrU0HG3smjpfAMHxWXPRW5tvdHo2au0WYaG72hN+Z3R5/gRuJA6ak ASPFyIohrVV+dlVuKs/67GY1ulKftYejcOXMbfgUIgPq8ok1e+ya8cqLTZgLqX0XNn9x QKOTXcAWX2xDtxCf++KNql6DzgWSUPd2jIIQbDeGO2SSVT62WDkntmWiBVcNWH/0BTmO dJW1EUxMAfwWgACDQmBr01aJjzJxT2LpMUfL8X0Ge321elrG+2EEQ3Huc4JsuBDh8Rz4 llRA== 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:cc:to :from:dkim-signature; bh=CwzhgiW7ITrxyd3SSfKf1YS1o/7m69672MVumGKkbhc=; b=zqa3htkU60+CQrlIKTlULqZ/mqHzK++2EWtBOdaiyBGn2GtYCMuR5ScWlDfXrvtM8u GAs+ktIrFV3pIwC9xgkOncnc9MV0kuX5f1YOXt0Q9G00wyfsrdNAuyveXLO6NAEqDExR CP0wKdCbkMS3VBWaApZMYw8U92Gvai42HLiHtpAazC2PpEdAjjD9hICpCVYglmr/RzXa Cj1ZhyEl5AMbnXuOL1TVRiP5vzUuL1lMLNbfJoYejGrGHvVQ2lEvhlrtCpOGy9NJUlUJ 7UT6CsEWW5zv6vRm07g3o/6I37vRF3qce4BTkFUmpAL+k9I8TZ9UTyXNv0veA6EHpHMs wvbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OsDhWQvR; 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: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id fh20-20020a0562141a1400b0056bea5ad78asi471239qvb.363.2023.02.15.21.48.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Feb 2023 21:48:04 -0800 (PST) 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=OsDhWQvR; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pSX7h-0003nU-TS; Thu, 16 Feb 2023 00:48:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pSX7f-0003ln-SX for qemu-devel@nongnu.org; Thu, 16 Feb 2023 00:48:00 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pSX7e-0005C0-Bk for qemu-devel@nongnu.org; Thu, 16 Feb 2023 00:47:59 -0500 Received: by mail-pj1-x102f.google.com with SMTP id bt4-20020a17090af00400b002341621377cso4751086pjb.2 for ; Wed, 15 Feb 2023 21:47:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CwzhgiW7ITrxyd3SSfKf1YS1o/7m69672MVumGKkbhc=; b=OsDhWQvRTDlaXx4+osPMx5z+xX15hix/wXxVqMvk3M9wUA1Re83C3h4I+2i+bt0YpT WNBQWuozrYNRSSQKxynymKm8imFC+IrFUTIrWXKPftI4hm/aR4H/DZhrQeOQAOzgFEm2 X74Vd9m1rvp8TCTHRUEmc4OX3onJy8XCs7rIkLp3sYb8B9ids9O/akQgxq1GbJGsit8N ZEI7Dc4sVvhe3a0/TieHgNj9vHT1sYvcu3XAhXANojrnODL09EArstXuyyuAUjQpbH3y 5uRcgggQrVyiMDiYX56GeExKQwSMOAR2xQIyxhYWmpUW94rAAuCZ3jjsBcXnfEPjFPzs E3aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CwzhgiW7ITrxyd3SSfKf1YS1o/7m69672MVumGKkbhc=; b=gCwNPsOlNlsGWd7OpUwrlnJK3nKZRKJ2/KsZdurDgCvOn6TVJx7wFeggjHzjCCP+bN dtvKtrOJ3VFA5GvU5AihN6W1Gsik9RDAgMGKqLWpFBHeEzvAiWf9Hs9arPnBiTuJw5Se Z/jr38ynTnBbHyl780QvrDJ3qEyr7E82iToEr4tNDxvWX0ve7bd63YJZA53WJ2igqJj5 Wc65um/cx+53HF2Tz9lnPfJAjUd3IWr1goUDXDzctslEH2c5FM+WTSMEeD8+76JACfdT vLgTirT/3uhWHEEiAcrueLdVM+dIwmFzVkvZ01dEAb81KufZfC7TttPGDr4NM9dky5Pi 1loQ== X-Gm-Message-State: AO0yUKWXWNT5hjtHUyqlh0+Yu1uWqPwyrHUeMKECpn2MtnSBEXrJ/pzZ RaOhYcjcSccdPU9W6G3+38D9A29YO0Un30JC+N4= X-Received: by 2002:a05:6a20:12ca:b0:b8:66d3:30aa with SMTP id v10-20020a056a2012ca00b000b866d330aamr5436650pzg.50.1676526476980; Wed, 15 Feb 2023 21:47:56 -0800 (PST) Received: from stoup.. (rrcs-74-87-59-234.west.biz.rr.com. [74.87.59.234]) by smtp.gmail.com with ESMTPSA id j184-20020a6380c1000000b0047917991e83sm358034pgd.48.2023.02.15.21.47.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 21:47:56 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu Subject: [PATCH v2 03/15] linux-user/sparc: Tidy syscall error return Date: Wed, 15 Feb 2023 19:45:04 -1000 Message-Id: <20230216054516.1267305-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216054516.1267305-1-richard.henderson@linaro.org> References: <20230216054516.1267305-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Reduce ifdefs with #define syscall_cc. Signed-off-by: Richard Henderson --- linux-user/sparc/cpu_loop.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/linux-user/sparc/cpu_loop.c b/linux-user/sparc/cpu_loop.c index d31ea057db..051a292ce5 100644 --- a/linux-user/sparc/cpu_loop.c +++ b/linux-user/sparc/cpu_loop.c @@ -149,10 +149,13 @@ static void flush_windows(CPUSPARCState *env) #endif } +/* Avoid ifdefs below for the abi32 and abi64 paths. */ #ifdef TARGET_ABI32 #define TARGET_TT_SYSCALL (TT_TRAP + 0x10) /* t_linux */ +#define syscall_cc psr #else #define TARGET_TT_SYSCALL (TT_TRAP + 0x6d) /* tl0_linux64 */ +#define syscall_cc xcc #endif void cpu_loop (CPUSPARCState *env) @@ -183,18 +186,10 @@ void cpu_loop (CPUSPARCState *env) break; } if ((abi_ulong)ret >= (abi_ulong)(-515)) { -#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) - env->xcc |= PSR_CARRY; -#else - env->psr |= PSR_CARRY; -#endif + env->syscall_cc |= PSR_CARRY; ret = -ret; } else { -#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) - env->xcc &= ~PSR_CARRY; -#else - env->psr &= ~PSR_CARRY; -#endif + env->syscall_cc &= ~PSR_CARRY; } env->regwptr[0] = ret; /* next instruction */