From patchwork Tue Apr 26 18:18:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 566097 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp3857089map; Tue, 26 Apr 2022 11:57:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymA4rzK6EsuLAByxns0IT91loq70oQxQ2bAEu29kdMrDbspXYEM7iVC5rz6coCvVDuhQul X-Received: by 2002:a81:1812:0:b0:2f7:b66f:bf3d with SMTP id 18-20020a811812000000b002f7b66fbf3dmr20687457ywy.263.1650999424409; Tue, 26 Apr 2022 11:57:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650999424; cv=none; d=google.com; s=arc-20160816; b=zdxb13RlL0cYPd/GQ3j1rM+qSDwQDD0FuU2A+BC890mQtHeQ8+dlluc6tBJKSgNCjx tdZuq53TczUo+BGPWYaPGb+QSXd3Gxc0u3MvKlqGf7bH5u6DPOYmCH9c2YM6qi4bVZmC xrAz1NL+gVLdkw3zuUsuW8OT47A5EU1L3uZ62cWr3OYRHQXbJt4/b9ppVsSuY0OrwAZA onb57gsYqZ5Dvht9jK4dOQpl5Uc8CbH/3VcA5MH+G2jxxS7TekOFwXkc4y1YWtkbBD4K BPVS63Sp3PZg4IjfqDk6/Op39XHZ20B/0eTGnDe7ajWU0M6Y8GQnYfzMcUaZP1Ph83h9 BfoA== 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=E+4Qd4E9HIFHi1BwjZ85dNcwW/a/s3TNOGQFzvuAjJM=; b=IGt8EPoDd5oplzlwPxvXg5VGnF60/I7brNwm4BL6MnL9T0yZ1Sip8v6brL1hECLgm/ wbEpSR8oc05wDXsoklGSep0cPLVyL26mrJYdRJHakzzGD8l4NeJXxrCyif4quLIuvBim D8+A7l3lG8twnBxtSFHkNC1ft3BnUsOKZNTiIDMCcW7QNduAW/fnCbgL/vzQ8g0ZeekY cx4tuxyfC+4+Axn7UzJ6ogDhVNp3kpSWWLgJTAUdWXybdbnv6IOaSKddrr7qm48LOSUD MkEvBEvImJsmOslDkROp0erpVggdWZzewtfMBk75w8DLfP4PzZUDngwVeQTraGZnRipX U1AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cHCv1jlG; 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 m123-20020a0dfc81000000b002f198af7314si15283155ywf.2.2022.04.26.11.57.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Apr 2022 11:57:04 -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=cHCv1jlG; 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]:44776 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1njQMx-0003pv-UA for patch@linaro.org; Tue, 26 Apr 2022 14:57:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njPmg-0002g0-VU for qemu-devel@nongnu.org; Tue, 26 Apr 2022 14:19:36 -0400 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]:33322) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1njPme-0004Qp-Gt for qemu-devel@nongnu.org; Tue, 26 Apr 2022 14:19:34 -0400 Received: by mail-pg1-x534.google.com with SMTP id k14so16764562pga.0 for ; Tue, 26 Apr 2022 11:19:30 -0700 (PDT) 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=E+4Qd4E9HIFHi1BwjZ85dNcwW/a/s3TNOGQFzvuAjJM=; b=cHCv1jlG4qfzF3vmLuJ8TByVOIV7ODPAmMR8z5XYh+bl2/IE5afeMSouPbkViS8aB1 DEq+bVgeUgBK4Jl956d+XMYM9bNALujRf3CsyOPQxjf4biQObMghoj3pxHMSc1449T7I 6FTCUIxnIUSIUChMPJYWGJaGoKdiFBnk2IJ7ZV9IIeND59CAy+g1mFgf5AfPviLKeI7L PNI1bqB5pyOomGrQll1euGAtxhoxHS65fJC5RwZWax3+79JxtFeHZnR+get5gqWPKpvb 3fjOoQSE9q/OMArwMx95TXVi9F2gwKKJQCSry1Hx0RkTm1uf8StBwXpooCwj3awhN3X0 gYbg== 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=E+4Qd4E9HIFHi1BwjZ85dNcwW/a/s3TNOGQFzvuAjJM=; b=tjMTSLp7q/ea+knLS0lGROdc0NkGpSe42vfbm6K2KwlEMYanNab7pVeCkaJcyotlmx 1MDXln4Sf/cPzHWhSeGwgduiAe+22UHzgW3MIqkHdlPCsFPqrQ+uwB+XzWjJEVs7xWMj leNanuleYJ2e+H21p4o9a1jfFxkIi+Y9Nz6h8/5XakZqWt4L3nVgsqYjUFQGcjMZnJxu SEMxglvX9P4PGUc7tKorvDPEWz/FrpiqGeACORr1xm149rohOPns3dPyzRvFRmYh25Md VdCXgN5KS3R1VRG3FLztQJpOva9bwuVB8NzC6IdNaiof4is4r3MUaQz549d1fLRcLrx6 9tMg== X-Gm-Message-State: AOAM533QHKxjYkcoQ/D4a+J6qD/71Hw5pCnAsLhlMnr+5FJyGo8f62/7 X8eFS+0+36Hj403OnLsAHNIEawlWXw2rtQ== X-Received: by 2002:a62:1b91:0:b0:50a:64d0:58a2 with SMTP id b139-20020a621b91000000b0050a64d058a2mr25670391pfb.38.1650997170097; Tue, 26 Apr 2022 11:19:30 -0700 (PDT) Received: from stoup.. (174-21-142-130.tukw.qwest.net. [174.21.142.130]) by smtp.gmail.com with ESMTPSA id j7-20020a056a00130700b004b9f7cd94a4sm16482827pfu.56.2022.04.26.11.19.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Apr 2022 11:19:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 24/68] target/nios2: Use hw/registerfields.h for CR_STATUS fields Date: Tue, 26 Apr 2022 11:18:23 -0700 Message-Id: <20220426181907.103691-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220426181907.103691-1-richard.henderson@linaro.org> References: <20220426181907.103691-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell 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. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-Id: <20220421151735.31996-25-richard.henderson@linaro.org> --- 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 68ff8033b6..562dca8195 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