From patchwork Tue Mar 8 07:19:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 549247 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6713:0:0:0:0 with SMTP id u19csp2388956mag; Mon, 7 Mar 2022 23:33:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJzylIZdZfcjnLzbMglh1Cvr3LaAF1DE7/TmSUBxpBocuy6WRDoMs55tqz6fH4VTA0t3wD5p X-Received: by 2002:ae9:e8ce:0:b0:67b:1373:2e6c with SMTP id a197-20020ae9e8ce000000b0067b13732e6cmr6617077qkg.746.1646724801501; Mon, 07 Mar 2022 23:33:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646724801; cv=none; d=google.com; s=arc-20160816; b=OeWqTbTXb0KP9HQt44A20nVBcm+z+wEox8wnnfnyKdSTi+skzdVxnZYYYDBA3uZOy9 loiRBY3oj3nOh7j6Oi0DzAEE954ltGXKZ6ZwNDxWCN314TUmTjWjAaviWNyBbQzUxhyx gGdnm760BjeSFpYBRCm5kSd6FwwqC9ksy/714WPeuomw6Tbz70Ds7MzNAEMyQZSSjDlW aCWuG0b54TTQTf0PRwF7yothhYzkbMbOXUA8yaQkxirpmPe8c8NNBPlb1AsxpRH231SJ O/sPZy4T2naQSgfJg16GyWlBC7CPbiRvdqzT2viEC68tMVhyB6i9uICku6bAK9E5beoX 9g/g== 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=JPTHTSr1fVu62i4usn5tZsGs9hYEq9+hrYhQRAip59M=; b=zbfPjYe/NfrzTg8jmChw8xOvzprL/ddIaegy2KUc9jjqVOzWlb39Xdv/dbsJ8/yumM Vn7jtHrIW5bRgzcosnvxHixk7piejNwP5gr9vIUWRESi+W15vxSMDMbrCWNBGvDVI2mb sWnEQQxAKxRD+A6TUh/ds0YxvoYZ2ZcVXjIR9BWDJeJKmSYxfgB/fUTXsSObfnmWDtzY hMT3HToqG2TSuaMVRH20HTOFPYU/Ii8DAaGCXmcEIaa3u0x6tX6Lqxv2pNoCi57q/b2a a27+TkY7DIKZn+ecgfo0vBp9e8mLzTz+C7G1EI13hWBsz/jS9jxV68mBtng9ueglA6Xg BVOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ZQjkmvvc; 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 s3-20020a05622a1a8300b002e06d4f3377si1505230qtc.441.2022.03.07.23.33.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Mar 2022 23:33:21 -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=ZQjkmvvc; 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]:48840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRULR-0005dD-25 for patch@linaro.org; Tue, 08 Mar 2022 02:33:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRU8z-0005BE-GH for qemu-devel@nongnu.org; Tue, 08 Mar 2022 02:20:31 -0500 Received: from [2607:f8b0:4864:20::635] (port=34445 helo=mail-pl1-x635.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRU8y-0006JW-2c for qemu-devel@nongnu.org; Tue, 08 Mar 2022 02:20:29 -0500 Received: by mail-pl1-x635.google.com with SMTP id s18so3041416plp.1 for ; Mon, 07 Mar 2022 23:20:27 -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=JPTHTSr1fVu62i4usn5tZsGs9hYEq9+hrYhQRAip59M=; b=ZQjkmvvcElCrcLyEr7hn5CcI2AKV5/0TyNDtBKzevA29sDKIR+thgKIlL7oTRAwoS4 6Lj3tROQhq/O5CVyI6MfXh98eD7N65jftHCcRkyZ/+c/gl6OOWGNNh2TKD7ueyETB1wQ Yf16bW7VxVI91gBdGYZOVVPvQjwEnBUuNZAFgFAoTxJS/nvRETS0875uJxzXl1qWnuxH LTnB5qDeZiTADGfI0ITnGBKmGqIogXTcqB7g25S7jkThvAJvjMFvQhV+bXi9zATJhNku dwWwFbn1lU1hq55DR4KTVEGlg61Xm9zItH8b2655IIBpu+r9XMaBYl2LtKeiUa/trGWd npUw== 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=JPTHTSr1fVu62i4usn5tZsGs9hYEq9+hrYhQRAip59M=; b=bvR4+JI8hVx4fztKOaFmWV1vd0wRI8tFBism58dJupUq2RV9YOtpVZZcfOo1c3rDFS NdEflPPTkM6JYgl3DdNLsHNaHNj7pWEVhL6hwfFojBnaVVhN81W317aOUq9ZGWelcgDh nAVrpriM8XV6dila1m1GaDViC9eSQrS4I6L9pQMyTN4NaFISZ2QLK2DaJtHgWfhIO54i Ii3FPEl8z8L1Ke0JVzzcjSkHFRD6MSMaUPBigtgBcbfHCfftRdaTwplqBTdw0wdhHIY+ bSGYWLS0rg0n8Q42wt3oi9/tXHM9pW7bJdhMwNzaD8hds2+y24PwSKwUJPPbii0F9Mvy FzFg== X-Gm-Message-State: AOAM531n8dwZVKnv/FCrzYWX4ZhJjASNnXUo5IFlvdCSapEZmDuf95Tw wz/dNulESyNM5rrd0cFz1IJf2zFduoKEtA== X-Received: by 2002:a17:902:7888:b0:148:adf2:9725 with SMTP id q8-20020a170902788800b00148adf29725mr16437305pll.136.1646724026808; Mon, 07 Mar 2022 23:20:26 -0800 (PST) Received: from localhost.localdomain (cpe-50-113-46-110.hawaii.res.rr.com. [50.113.46.110]) by smtp.gmail.com with ESMTPSA id p125-20020a622983000000b004f6c5d58225sm13790899pfp.90.2022.03.07.23.20.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 23:20:26 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 11/33] target/nios2: Use hw/registerfields.h for CR_STATUS fields Date: Mon, 7 Mar 2022 21:19:43 -1000 Message-Id: <20220308072005.307955-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220308072005.307955-1-richard.henderson@linaro.org> References: <20220308072005.307955-1-richard.henderson@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::635 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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 | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 5bc0e353b4..26618baa70 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 CPUNios2State CPUNios2State; @@ -80,15 +81,23 @@ 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) + +#define CR_STATUS_PIE (1u << R_CR_STATUS_PIE_SHIFT) +#define CR_STATUS_U (1u << R_CR_STATUS_U_SHIFT) +#define CR_STATUS_EH (1u << R_CR_STATUS_EH_SHIFT) +#define CR_STATUS_IH (1u << R_CR_STATUS_IH_SHIFT) +#define CR_STATUS_NMI (1u << R_CR_STATUS_NMI_SHIFT) +#define CR_STATUS_RSIE (1u << R_CR_STATUS_RSIE_SHIFT) + #define CR_ESTATUS 1 #define CR_BSTATUS 2 #define CR_IENABLE 3