From patchwork Thu Apr 21 15:16:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 564353 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6886:0:0:0:0 with SMTP id m6csp547494map; Thu, 21 Apr 2022 08:38:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwx3fFbTlaDYjIeUtpWliVXfPCtDGDWv8vzOomcaB6GFat85Za8nTbkqnoRDMNusxyv2TIe X-Received: by 2002:a05:6902:1007:b0:644:cbfd:40a6 with SMTP id w7-20020a056902100700b00644cbfd40a6mr231863ybt.355.1650555518708; Thu, 21 Apr 2022 08:38:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650555518; cv=none; d=google.com; s=arc-20160816; b=RL+91nUDNWMoG5QVZ/uzgR5wJLd3Wq3Gaun8hNvftGlbNoaVJZ/3tjQN+FburkSk1B CeSxuHKA4CRV7flg22suR2ksEXlfeevgqTxydgpEopYClDkvMMS9rJyUEU8JHResPgYc 8ln/XRwlaLvBxoJkgOXpKQ42ioT/6IeIILxEeX7WftSZbLZ6qQbCjf32grJjxi4G/wZe IFl2hsrasaP81Thx0DmCXiQ1V5SJrfs4pndHysOHIlCGPDs4ZpHda1YY4gxLwwaBunWM A5gb5xTYpPKMHklDoi7zP90kqGBw0kRBIHEh0eMP+pW7vMGC10BFOEFfqpbM0bX0aJBs Ul9A== 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=+mtXVKAjUVRS64m73YmB+z7ejlvTN+BDSTEhooEYEys=; b=tLAUmcOQWaqsVen3PBq7ZpBJkyq8xHtrJZ1SigAID/cdcb9IGJqxRW1b63ihwf2JIS kpCp0fMqjzQQNC/viKd/cR2/e+rb7xpg4UEjF2vfOnI1j8obSs5wJjzgLWPzzuPa/bVx kSRk0/cHDdLkkCNSaEN8yMQu/NoUmOsxHfdqqIuAtWOTk9D2VtlcCIubMO1iZZz6WDZ/ s/gG+XBG3Zk8WAoEhC29wWaoFpVi7kJjlRs2z/HP+s4QZ5x01eR8u07aQHlW7u59fMin Gc7oD/vbeTDwZqSZVmXDbJc+hhogd2UwT6pji/pzQsJRbgQS34yu9BuaDYZfUWnVOwXs 2JMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dB03xJOe; 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 s129-20020a815e87000000b002e5bb9dca20si2822218ywb.169.2022.04.21.08.38.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Apr 2022 08:38:38 -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=dB03xJOe; 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]:38406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhYtC-0003f8-6w for patch@linaro.org; Thu, 21 Apr 2022 11:38:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42996) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhYZW-0007YD-KE for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:18:18 -0400 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]:43758) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhYZU-0006J9-Fj for qemu-devel@nongnu.org; Thu, 21 Apr 2022 11:18:18 -0400 Received: by mail-pl1-x630.google.com with SMTP id d15so5156711pll.10 for ; Thu, 21 Apr 2022 08:18:16 -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=+mtXVKAjUVRS64m73YmB+z7ejlvTN+BDSTEhooEYEys=; b=dB03xJOetW7gTapLPP0j6HdcdtCdxbbAt+h+wm4mqZ4Z4aNjr3CbCJt0zoc0bxzvPe +xr/aMue4nuyUISm/t0yYqdpDFfch5Nv9uv+uVB1yvkVdof1FFFzgXQ15/8Ba2A2xtYk WOR6RWjRspCgv+XOnkzUvis4QSlDXvVVBi2nzYymEW9K4QrkXcQ7WKlRV5FLlhMmt60Q /0TnrPIeHtOQDAPterPQ+lNd6CHvssAloT4B/IEIq1a5MT+FSmbcm4slJ4jRzVYPLP+W SVf1w+MGGhBBKyaJ52y9Vc6SZYCSKT2kVELzpK38rCib+ey6VMQsPwG2HEZBOtWbdZbR 9rog== 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=+mtXVKAjUVRS64m73YmB+z7ejlvTN+BDSTEhooEYEys=; b=IlhPap6Y81aMItbEDRdv0TgJt/k2QnYHx0BMk8gfnD+U0a0/7KbnHO65K5ySoPFwys D6CA/c5ld1wg5jjnZFikf/8hQwsohHYVrznmm3fT0tDcbBu2I8ROzHcxHbG6X/Qc5Ifc biMH2ZawIeVIvLa9IzJB7WtP1H2MneO2fEFignp3n+ZcyOxoyV5RMYgmxlz2NAa8Z7YP cQIy5tQIC6jegmfJGlcHlWxyMOlt8Z/0BF3COcQ/z156yyttcn4B4a3fcS4uXohzuPC/ 5lrMlWETFb6i/1VuCZcfluLjT2hqoTi72XFN8d4iaGDDBriYFT6prhTQ82Nx/khaafL3 Lmtg== X-Gm-Message-State: AOAM5319m7ieI0IjsT2fyql8D2KQ/rvn/meRN/pZu9FGriVnDD0lAbDA 3SUhjQrQMvOevk+74fNQ92DMByRnQ9cHVA== X-Received: by 2002:a17:902:ea4f:b0:158:5013:1403 with SMTP id r15-20020a170902ea4f00b0015850131403mr26076510plg.75.1650554295167; Thu, 21 Apr 2022 08:18:15 -0700 (PDT) Received: from stoup.. ([2607:fb90:80c8:6cf3:a91a:4957:ba18:ac18]) by smtp.gmail.com with ESMTPSA id z16-20020a056a00241000b004f3a647ae89sm24616248pfh.174.2022.04.21.08.18.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 08:18:14 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v7 24/64] target/nios2: Use hw/registerfields.h for CR_STATUS fields Date: Thu, 21 Apr 2022 08:16:55 -0700 Message-Id: <20220421151735.31996-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220421151735.31996-1-richard.henderson@linaro.org> References: <20220421151735.31996-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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 --- 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 872bc2a46f..44fc681c58 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