From patchwork Tue Jun 29 18:54:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 468342 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp5256211jao; Tue, 29 Jun 2021 12:34:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMJvkAhbhL9O5hLisBlhoBo4ddQmR+U5uT9boXANAwkJoVKTI44YOXy7Vy0u3bIH7W6U0K X-Received: by 2002:a05:6902:102d:: with SMTP id x13mr43625887ybt.408.1624995287914; Tue, 29 Jun 2021 12:34:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624995287; cv=none; d=google.com; s=arc-20160816; b=FfhRaK+kyL+4b1aCZqZl1GNqCjRQBzAKFSFxDGDqtHs4wApNlvHbTFsI0nWlkObSA2 L0SSqrA7qY8FG2dgj2pH6zSggH0BJz6jMsp9lzSFWbyVCB1UYAXg6MkoJFqRmIlCBVFC vF8k95vwL5W/6JIG3V8k2feD8fSmRVRE1w337/Wq4vWY1JNfFVY/e3D+n9TRDY2sThsb EzlRch2tXSM8Q4OMk+IjLBsV2Z5WIIjGQuRN8dB1LFZ6w/uMUXMaVAsOjOc2KqqkcH3J AigpUIL6vJHH6yjhW9rhr5H3+yS3STDGFTmkSOvu6rXBQxgn74P07uqYGUKIK7/vG5Gp SLpA== 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=UDzjdzY2uNgirunivl38O17B6vfKe1pDPaF+QZIpYjM=; b=pVMo/FRLCQoUAWa716z0VtyBDEcumoGIJaEO0SCDRxJT3xUUH9rHOERSbnnvgyp0Gb uvhn7dOXWNS/LpkOBQSxuU5sac1sLJFxbw4O6/EGE8FSzvTssYGgcIq1QdglikGkWvAz BRgDZtRGdFqFhL4zxKpeI2T2nSri/C1Ms+4OpCYU6Vwz3dnE2dj3fNkHf/z9Z/UWaS02 brqk43vPeWE6i9aRtlww6sV38yiHutRuBklMYgOgli31yZOt54cEZIWW2JRMEQzp95KT r8YJ5kSNo7AvKUmYnZuYx/Hf9lFsIybn6y+uJtFTzCXiKt7Siu6Gl8IaK2+Nc9IyfaOr VMEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="IDf7F/H8"; 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 m11si7625851ybp.374.2021.06.29.12.34.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 Jun 2021 12:34:47 -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="IDf7F/H8"; 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]:36372 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyJVP-0002UL-DA for patch@linaro.org; Tue, 29 Jun 2021 15:34:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyItF-0008CE-Jd for qemu-devel@nongnu.org; Tue, 29 Jun 2021 14:55:21 -0400 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:40602) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lyItA-0000ta-0N for qemu-devel@nongnu.org; Tue, 29 Jun 2021 14:55:21 -0400 Received: by mail-pj1-x102c.google.com with SMTP id bb10-20020a17090b008ab029016eef083425so2556316pjb.5 for ; Tue, 29 Jun 2021 11:55:08 -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=UDzjdzY2uNgirunivl38O17B6vfKe1pDPaF+QZIpYjM=; b=IDf7F/H87WZSPij1x46NiqLZub5PUnG986U3ixBWWB+7GYfgcoX33dd+26ujFL+JdZ IlCWjEzUtFL8Y5F9gEDl7i+AWhKfZiZmY9Slfkm93Gt6xjop5frRcbvrDi70ZZnZSjFP LYxEcdQ/+Lwp/q8QCN5Rl//r3nB4wtYXNm8Y2aMUD8K+pvx//i+SUUJCNlddqtrPKeQD qgxd0awCP201CsOmHRjQWdrWI0YZ5lmKj1/1sijDwm/E9t7O8+cxHJLsTFotUuCOrd8U P9TR1BX+Be+HViUzuDH8HOE417V9F6ZCg8SwgpGSn1qEchzOqu3+AX5BxofsCCaw0kD+ /hkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UDzjdzY2uNgirunivl38O17B6vfKe1pDPaF+QZIpYjM=; b=UyMNu5oi7brbzSmw/Eg806Msyt3rY4zNpwv9PVcYdiwxuoxI9COI/OXxcWBpeOxeCR 5EjFH7a+leR5ERmHafDzGvy8fba9hXRDiAB0yengh9BpgMA4DPtnQxq+Y8auzahRm1VW iC5Z9hulUEkSL0UUVrRK/X3rgYq+i/nzQ3PbdoKoKA0decCxi5G7SGrD2t96oo6L2EdT Fl1bVPxZS8m0fNQVLUfuqaytq0SMt6qhHHLwrFzJvoDeSC/QStjELyGl/5LauwREZiDw rlOGPzlWfUI0DCj0xBPwDEUODGhjdS2goeIesg6dO2+/pUhVyoLfjD5Vi33JbB+qN9eM sOug== X-Gm-Message-State: AOAM531AGTGH7fIEXaK5Mw2RlXEi9mf9h+rgljeINIGcoaOhZXd0od/Z 885nI7FgjIi2cfpwQzwE/s/BmPLvM5a3Ww== X-Received: by 2002:a17:90a:f0c3:: with SMTP id fa3mr19518267pjb.90.1624992907414; Tue, 29 Jun 2021 11:55:07 -0700 (PDT) Received: from localhost.localdomain ([71.212.149.176]) by smtp.gmail.com with ESMTPSA id j2sm18811253pfb.53.2021.06.29.11.55.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Jun 2021 11:55:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PULL 20/63] target/cris: Mark static arrays const Date: Tue, 29 Jun 2021 11:54:12 -0700 Message-Id: <20210629185455.3131172-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210629185455.3131172-1-richard.henderson@linaro.org> References: <20210629185455.3131172-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102c.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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Edgar E . Iglesias" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Reviewed-by: Edgar E. Iglesias Tested-by: Edgar E. Iglesias Signed-off-by: Richard Henderson --- target/cris/translate.c | 19 ++++++++++--------- target/cris/translate_v10.c.inc | 6 +++--- 2 files changed, 13 insertions(+), 12 deletions(-) -- 2.25.1 diff --git a/target/cris/translate.c b/target/cris/translate.c index eabede5251..e14b7acb10 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -137,14 +137,15 @@ static void gen_BUG(DisasContext *dc, const char *file, int line) cpu_abort(CPU(dc->cpu), "%s:%d pc=%x\n", file, line, dc->pc); } -static const char *regnames_v32[] = +static const char * const regnames_v32[] = { "$r0", "$r1", "$r2", "$r3", "$r4", "$r5", "$r6", "$r7", "$r8", "$r9", "$r10", "$r11", "$r12", "$r13", "$sp", "$acr", }; -static const char *pregnames_v32[] = + +static const char * const pregnames_v32[] = { "$bz", "$vr", "$pid", "$srs", "$wz", "$exs", "$eda", "$mof", @@ -153,7 +154,7 @@ static const char *pregnames_v32[] = }; /* We need this table to handle preg-moves with implicit width. */ -static int preg_sizes[] = { +static const int preg_sizes[] = { 1, /* bz. */ 1, /* vr. */ 4, /* pid. */ @@ -475,9 +476,9 @@ static inline void t_gen_swapw(TCGv d, TCGv s) ((T0 >> 5) & 0x02020202) | ((T0 >> 7) & 0x01010101)); */ -static inline void t_gen_swapr(TCGv d, TCGv s) +static void t_gen_swapr(TCGv d, TCGv s) { - struct { + static const struct { int shift; /* LSL when positive, LSR when negative. */ uint32_t mask; } bitrev[] = { @@ -1279,7 +1280,7 @@ static int dec_prep_alu_m(CPUCRISState *env, DisasContext *dc, #if DISAS_CRIS static const char *cc_name(int cc) { - static const char *cc_names[16] = { + static const char * const cc_names[16] = { "cc", "cs", "ne", "eq", "vc", "vs", "pl", "mi", "ls", "hi", "ge", "lt", "gt", "le", "a", "p" }; @@ -2926,7 +2927,7 @@ static int dec_null(CPUCRISState *env, DisasContext *dc) return 2; } -static struct decoder_info { +static const struct decoder_info { struct { uint32_t bits; uint32_t mask; @@ -3363,8 +3364,8 @@ void cris_cpu_dump_state(CPUState *cs, FILE *f, int flags) { CRISCPU *cpu = CRIS_CPU(cs); CPUCRISState *env = &cpu->env; - const char **regnames; - const char **pregnames; + const char * const *regnames; + const char * const *pregnames; int i; if (!env) { diff --git a/target/cris/translate_v10.c.inc b/target/cris/translate_v10.c.inc index 0ba2aca96f..4ab43dc404 100644 --- a/target/cris/translate_v10.c.inc +++ b/target/cris/translate_v10.c.inc @@ -21,7 +21,7 @@ #include "qemu/osdep.h" #include "crisv10-decode.h" -static const char *regnames_v10[] = +static const char * const regnames_v10[] = { "$r0", "$r1", "$r2", "$r3", "$r4", "$r5", "$r6", "$r7", @@ -29,7 +29,7 @@ static const char *regnames_v10[] = "$r12", "$r13", "$sp", "$pc", }; -static const char *pregnames_v10[] = +static const char * const pregnames_v10[] = { "$bz", "$vr", "$p2", "$p3", "$wz", "$ccr", "$p6-prefix", "$mof", @@ -38,7 +38,7 @@ static const char *pregnames_v10[] = }; /* We need this table to handle preg-moves with implicit width. */ -static int preg_sizes_v10[] = { +static const int preg_sizes_v10[] = { 1, /* bz. */ 1, /* vr. */ 1, /* pid. */