From patchwork Tue Mar 8 07:19:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 549254 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:6713:0:0:0:0 with SMTP id u19csp2392816mag; Mon, 7 Mar 2022 23:40:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJx0oqvfFLbPO5sp4HQUi8DVEUvc73paeDn4EdU04V5UnvHiZcrPeVApMhE7to+/6w9kHP/4 X-Received: by 2002:ac8:5ace:0:b0:2d8:c7fa:6f8f with SMTP id d14-20020ac85ace000000b002d8c7fa6f8fmr12170355qtd.410.1646725244706; Mon, 07 Mar 2022 23:40:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646725244; cv=none; d=google.com; s=arc-20160816; b=Su10x7N8AsJQHV8iu4FUPCYHmGYCHzlb3jzNPYRN0IOvvKRRcUhnW0IkHrz3/Tz+dv o3AsCJeFWPM6SrvnDXcB1CRtCTc3R0YJwrALWzMwwEP7615wMDO3D1PAVcTDtbCE0q2l NcYzHGThJ6Dhu7iKbjRO7W4z5Ka1Ed80YSFfCn9Z9DDEY9oFJh4BP7JqV6s3VgcRBr3U JpupJ8Dx5r6GPuaBj5Y9I6jqOcmwvUpZfN6R6vzp4begKAoFMLOhO4rwmEIihxEu/EeJ 78WNIQRWcb/fOVpAy15HIPzr2gsF9oBgqDvvHH/LPhZpSFcngMino37ZHIastlUyi69J yhiw== 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=hVtoqbC1gYoYHHn2DZhJOouijVB0naPV7yAJTXjEzIc=; b=dheb1DQXSUgh62EXbt3TtrmdZEBkN6VImYWE6VkuPqKeospQ91t5ScxLRnAnV4SQNv H2FlX91tks7UpoGzyZqy7dFWGHGHU+ZVwGND1gY8p0iF4x0eRjTMCJn6093O/aF2Gl9R ewPSGRJIjnUrSZJk2CU/RmahLtD2fb2YRkoBABZbKoZNIcXUIC7KZgHXfQkbXMcXJyHX WHpLMvNu1rnNbpzlzqs4uPXF9qXX+ph2A0WTMXKaIp94PnF82TRYAEh9YXQJlcQvc/ee 9xfQrkzc8uw2jWbNbE+2zd4qGT+F0t0JZpwxwNWb/TkbO6fZJfF0vGtiPMbudw4E73HX CebQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=vFdMzqmA; 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 i10-20020ad45c6a000000b0043550529653si5408741qvh.104.2022.03.07.23.40.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Mar 2022 23:40:44 -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=vFdMzqmA; 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]:37836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRUSa-0000Ji-6p for patch@linaro.org; Tue, 08 Mar 2022 02:40:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRU99-0005Eh-3T for qemu-devel@nongnu.org; Tue, 08 Mar 2022 02:20:42 -0500 Received: from [2607:f8b0:4864:20::102d] (port=53013 helo=mail-pj1-x102d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRU96-0006Ln-Ho for qemu-devel@nongnu.org; Tue, 08 Mar 2022 02:20:38 -0500 Received: by mail-pj1-x102d.google.com with SMTP id v4so16353597pjh.2 for ; Mon, 07 Mar 2022 23:20:35 -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=hVtoqbC1gYoYHHn2DZhJOouijVB0naPV7yAJTXjEzIc=; b=vFdMzqmAiOXr4N3ZdM3PSH9hPhoimvTpZrMy5ZzZAa5p0tLx+emOOlUsduidGST7BJ UVgE3Q49Q5KsIBF5ZUcozZEBerIOOKJy0hfZQ6Qe4FgxBN4HJHSp+jRo2hJO+sHXjLuE RGioIH+PK6m1x/QQLyIEvDdmnfOZ//VBwMhwJVYFASpszh0WYg+Z2pejf8vW1jYTaIDF b57n/go+RYZy6rXWsiKdT6Tpm1uF2YJ72/qdjVhTjm7H7++0XlDLqs7IXhXfADLw4AfD 0UcJll2pydtVXa9H58JZoW6vG61/sSzW5Vv5CinnKGWiYmQJJkSAv6FV6oZEABr3ztCu LLnw== 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=hVtoqbC1gYoYHHn2DZhJOouijVB0naPV7yAJTXjEzIc=; b=3+VAh/sLSV6nTcOAkRJvFDaVzbySCARwKEPRDnlrp/36UO9sdCSBXE1qMA09ADjNyr ZFG5BEhm03YA5u9/vob3ZlJN5JNf6FZv8B8eRlJ7+bD7xXxpR1kTLl1d5E+dKMxXV2JS 7odXY2NkmgdGmfcKRoghl52juF880r/2/xlIakD2p5hG5ahG8oAbeVwQlK1Ig1MyRgZm aPs0IA//v2XNBJM33OL0xM2QRMgZIjvmJILSiX6z0gRh4cP9wZeGeu+W0I2PI4HRPk1k zXxOVtYmx5M6zunHkv7tR6NP7UfqOBv6EJ185JWDsZK3XKshC0WUEDbEdMotUkaBrioj LLeg== X-Gm-Message-State: AOAM5338NMQCfm3tjZBLB/6c1bMFHkGmbdoh4l9FCY6xTQwRWd0ZcSWP KAL1liLdjNGgjMSNViKfb+VaXhHn/cW4gg== X-Received: by 2002:a17:902:c443:b0:151:ca88:684 with SMTP id m3-20020a170902c44300b00151ca880684mr16193129plm.80.1646724034610; Mon, 07 Mar 2022 23:20:34 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 23:20:34 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v4 16/33] target/nios2: Move R_FOO and CR_BAR into enumerations Date: Mon, 7 Mar 2022 21:19:48 -1000 Message-Id: <20220308072005.307955-17-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::102d (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.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, UPPERCASE_50_75=0.008 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" These symbols become available to the debugger. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- target/nios2/cpu.h | 72 ++++++++++++++++++++++------------------------ 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h index 3857848f7c..927c4aaa80 100644 --- a/target/nios2/cpu.h +++ b/target/nios2/cpu.h @@ -62,25 +62,43 @@ struct Nios2CPUClass { #define NUM_CR_REGS 32 /* General purpose register aliases */ -#define R_ZERO 0 -#define R_AT 1 -#define R_RET0 2 -#define R_RET1 3 -#define R_ARG0 4 -#define R_ARG1 5 -#define R_ARG2 6 -#define R_ARG3 7 -#define R_ET 24 -#define R_BT 25 -#define R_GP 26 -#define R_SP 27 -#define R_FP 28 -#define R_EA 29 -#define R_BA 30 -#define R_RA 31 +enum { + R_ZERO = 0, + R_AT = 1, + R_RET0 = 2, + R_RET1 = 3, + R_ARG0 = 4, + R_ARG1 = 5, + R_ARG2 = 6, + R_ARG3 = 7, + R_ET = 24, + R_BT = 25, + R_GP = 26, + R_SP = 27, + R_FP = 28, + R_EA = 29, + R_BA = 30, + R_RA = 31, +}; /* Control register aliases */ -#define CR_STATUS 0 +enum { + CR_STATUS = 0, + CR_ESTATUS = 1, + CR_BSTATUS = 2, + CR_IENABLE = 3, + CR_IPENDING = 4, + CR_CPUID = 5, + CR_EXCEPTION = 7, + CR_PTEADDR = 8, + CR_TLBACC = 9, + CR_TLBMISC = 10, + CR_ENCINJ = 11, + CR_BADADDR = 12, + CR_CONFIG = 13, + CR_MPUBASE = 14, + CR_MPUACC = 15, +}; FIELD(CR_STATUS, PIE, 0, 1) FIELD(CR_STATUS, U, 1, 1) @@ -98,24 +116,12 @@ FIELD(CR_STATUS, NMI, 22, 1) #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 -#define CR_IPENDING 4 -#define CR_CPUID 5 -#define CR_CTL6 6 -#define CR_EXCEPTION 7 - FIELD(CR_EXCEPTION, CAUSE, 2, 5) FIELD(CR_EXCEPTION, ECCFTL, 31, 1) -#define CR_PTEADDR 8 - FIELD(CR_PTEADDR, VPN, 2, 20) FIELD(CR_PTEADDR, PTBASE, 22, 10) -#define CR_TLBACC 9 - FIELD(CR_TLBACC, PFN, 0, 20) FIELD(CR_TLBACC, G, 20, 1) FIELD(CR_TLBACC, X, 21, 1) @@ -130,8 +136,6 @@ FIELD(CR_TLBACC, IG, 25, 7) #define CR_TLBACC_X (1u << R_CR_TLBACC_X_SHIFT) #define CR_TLBACC_G (1u << R_CR_TLBACC_G_SHIFT) -#define CR_TLBMISC 10 - FIELD(CR_TLBMISC, D, 0, 1) FIELD(CR_TLBMISC, PERM, 1, 1) FIELD(CR_TLBMISC, BAD, 2, 1) @@ -149,12 +153,6 @@ FIELD(CR_TLBMISC, EE, 24, 1) #define CR_TLBMISC_PERM (1u << R_CR_TLBMISC_PERM_SHIFT) #define CR_TLBMISC_D (1u << R_CR_TLBMISC_D_SHIFT) -#define CR_ENCINJ 11 -#define CR_BADADDR 12 -#define CR_CONFIG 13 -#define CR_MPUBASE 14 -#define CR_MPUACC 15 - /* Exceptions */ #define EXCP_BREAK 0x1000 #define EXCP_RESET 0