From patchwork Thu Mar 10 11:26:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 550100 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6713:0:0:0:0 with SMTP id u19csp913298mag; Thu, 10 Mar 2022 03:48:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTH8r7tDuBvuRtNv9rygbX/P/4Sv+0XNanGHvnIbyPPs/uQJDXEEdTtIvYVe1QvFIY85dV X-Received: by 2002:a81:4958:0:b0:2dc:62b7:8629 with SMTP id w85-20020a814958000000b002dc62b78629mr3534966ywa.48.1646912931379; Thu, 10 Mar 2022 03:48:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646912931; cv=none; d=google.com; s=arc-20160816; b=hNrRtZj8gPOA9wtu/WjujRMF7tBd+Y08Pp/qSneyXB55mx9yEtdQrJdFYd9MeUDNS8 0X8NdwZwfI6SvD9SBO8Cp4mV20bOAXTMJzqHqzsEfuqBlX7kfk6u3a5mcHIpb5n05hit VPOGxMf1wRuOtTt4+k1rjNDj5dxBTp//47s9qtkEnonAOOnsonBSCE7z3dyNGtHl6J2n CNzzJqgm1CY/zSsRLE+3GZN5wwRqjhKAJbdUhWXANdM3bvxv/N5r1dH9lbpPuAl44NAj ZYezI8QaIMaWifc3Th+OooJPYobqoQFjsKzw4EkG7y7+Q+hpwo5qdgroSJZHOD3v67AD Df2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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=Gt6Df7YFZj3yIOaHOAXNxeneFRB5t2HH9HYYGKeZPd8=; b=tC9JdZ+dCrKR3eBFCzzBddlrNVcXUjeN4iWSapCV8+wntXZGnig7umSwNz/4QTUduq HLLy/5D97azuRBRMqsMScw8QrQ9uZpvJKnNHm+iKuhfIk6CGeiziTEVOl9zSdFjsbLt1 iUl8u15cSfBtlCIBUQvavT/BsJNTD6ermYnq9LZT8Zc0TFAsKwNQV3jzRxL3WGuFOQAe XQRWy868hruxqSo3jHS88ntXBA74lJIa1abZ4KWSDqAEard2MMAXEO2d6p6SvHYgbdtd Rqq8WuwakZKJVlKfZh8kn1It2DKh9eYctT5huDf7APJ8KU0jqPUn+ngzAXa+LMD2Kp8Q U9dA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=AQQXji4r; 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=fail (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 n5-20020a81c805000000b002d6464c229bsi2974172ywi.3.2022.03.10.03.48.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Mar 2022 03:48:51 -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=fail header.i=@linaro.org header.s=google header.b=AQQXji4r; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42920 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nSHHm-0008Vp-Tr for patch@linaro.org; Thu, 10 Mar 2022 06:48:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSGxL-0005K0-T2 for qemu-devel@nongnu.org; Thu, 10 Mar 2022 06:27:43 -0500 Received: from [2607:f8b0:4864:20::1034] (port=50878 helo=mail-pj1-x1034.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nSGxK-0007x0-Cw for qemu-devel@nongnu.org; Thu, 10 Mar 2022 06:27:43 -0500 Received: by mail-pj1-x1034.google.com with SMTP id m22so5002437pja.0 for ; Thu, 10 Mar 2022 03:27:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Gt6Df7YFZj3yIOaHOAXNxeneFRB5t2HH9HYYGKeZPd8=; b=AQQXji4rnhgAAQr38u97QZIOMNlTdasBbQ7aHHiB8yScDZKedi6AtTrbId/+2BcOCO dN5wqSTiaIBg8UMqHOCHu5CKdm0JDCd1R4IC4v6mGaJdc77XQP2JLJ4yTBbRfHUwvNYt C/Fwc9cY9atZVRMlq7DgpRsJZmn78YUbSI/p5uQ6AG7InqVG3/6kZm78TjCYR7O/tF6Z 87ZqLw9rwQ18H2vRNSJ8K52hrsTiuL+J/c6gnnsgX6frGiTodXbLZLMwzpAeBYxvNNNc p7HjteW6o52zyO1dJB2mxkktP2yen9yAfjtF4zI7kvQVU52agMo+441sWsj3nfeFyTvt UlFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Gt6Df7YFZj3yIOaHOAXNxeneFRB5t2HH9HYYGKeZPd8=; b=pgug3/BGsuh63Wn6NI/HUF5axexjTQ6mz0IRwB84pSK0p1XDtvM6CA6fhP9Y/nMrxq HegeFRbgxu2BbP9gcE2oNkEscPJ/gLcXJzeqbfmLiFm8HZqKoOQtA+tEKd+x9/ox6PC7 EOh8b05LBp+Gx6P9vwoQBCZCHI81Nl4Aztdv4gq85LJaLd3Jk3RZf5CkHTCGDabPlz52 FVJfMhXBXOWrr7oBDE8nltuFrAFdyQDSW3zS/C0ete7sT4zRZ1aMhUKa3AnjdzXMGEQT vQha4ENLBLeTJKkVptaEqDmkK7E6P7GOQfMgYW1UWWPrsoVYKrSuwn3PweeeYOTs9koB 5bwQ== X-Gm-Message-State: AOAM532zdCBnLr2eYTxEwnNFZU8qkWGs+0hJlDlHhcNnEynQBAbGlswl l9p5IJhei/+dkPJoUlv9QYvKt4sQ1zXfZA== X-Received: by 2002:a17:90b:4a07:b0:1bf:b159:185 with SMTP id kk7-20020a17090b4a0700b001bfb1590185mr4537730pjb.65.1646911661058; Thu, 10 Mar 2022 03:27:41 -0800 (PST) Received: from localhost.localdomain (174-21-142-130.tukw.qwest.net. [174.21.142.130]) by smtp.gmail.com with ESMTPSA id js15-20020a17090b148f00b001bfc8614b93sm3114977pjb.1.2022.03.10.03.27.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Mar 2022 03:27:40 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v5 13/48] target/nios2: Use hw/registerfields.h for CR_STATUS fields Date: Thu, 10 Mar 2022 03:26:50 -0800 Message-Id: <20220310112725.570053-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220310112725.570053-1-richard.henderson@linaro.org> References: <20220310112725.570053-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1034 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: marex@denx.de, peter.maydell@linaro.org, amir.gonnen@neuroblade.ai Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Add all fields; retain the helper macros for single bit fields. So far there are no uses of the multi-bit status fields. Signed-off-by: Richard Henderson --- target/nios2/cpu.h | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 1bcbc9ed63..ecf8cc929f 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -23,6 +23,7 @@ #include "exec/cpu-defs.h" #include "hw/core/cpu.h" +#include "hw/registerfields.h" #include "qom/object.h" typedef struct CPUArchState CPUNios2State; @@ -79,15 +80,24 @@ struct Nios2CPUClass { /* Control register aliases */ #define CR_STATUS 0 -#define CR_STATUS_PIE (1 << 0) -#define CR_STATUS_U (1 << 1) -#define CR_STATUS_EH (1 << 2) -#define CR_STATUS_IH (1 << 3) -#define CR_STATUS_IL (63 << 4) -#define CR_STATUS_CRS (63 << 10) -#define CR_STATUS_PRS (63 << 16) -#define CR_STATUS_NMI (1 << 22) -#define CR_STATUS_RSIE (1 << 23) + +FIELD(CR_STATUS, PIE, 0, 1) +FIELD(CR_STATUS, U, 1, 1) +FIELD(CR_STATUS, EH, 2, 1) +FIELD(CR_STATUS, IH, 3, 1) +FIELD(CR_STATUS, IL, 4, 6) +FIELD(CR_STATUS, CRS, 10, 6) +FIELD(CR_STATUS, PRS, 16, 6) +FIELD(CR_STATUS, NMI, 22, 1) +FIELD(CR_STATUS, RSIE, 23, 1) + +#define CR_STATUS_PIE R_CR_STATUS_PIE_MASK +#define CR_STATUS_U R_CR_STATUS_U_MASK +#define CR_STATUS_EH R_CR_STATUS_EH_MASK +#define CR_STATUS_IH R_CR_STATUS_IH_MASK +#define CR_STATUS_NMI R_CR_STATUS_NMI_MASK +#define CR_STATUS_RSIE R_CR_STATUS_RSIE_MASK + #define CR_ESTATUS 1 #define CR_BSTATUS 2 #define CR_IENABLE 3