From patchwork Mon Jan 29 23:30:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 767480 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp1127344wro; Mon, 29 Jan 2024 15:37:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IEC8up870Giwy4DY0VCUjzReMBWxzEkXNcWlJewjd5uj7gSuDaXkJ6RyRKo71Sso5dovUXN X-Received: by 2002:a0c:f2cf:0:b0:68c:46ee:de71 with SMTP id c15-20020a0cf2cf000000b0068c46eede71mr107707qvm.1.1706571457613; Mon, 29 Jan 2024 15:37:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706571457; cv=none; d=google.com; s=arc-20160816; b=T2vmWJhxAC9kizWcfWXsCephQFZBIJhDzhhe3mOeIEADrW6O/TDs/EebebpFzgSOHN YIIIGJCK2ZPEGdJ/FlJHNU57OxWrRj84gUzo0x1c6Xw+8sKAaW9dp9WDHlbYchjqRhN0 p3l0bRAgLOudrORhdE76KzzGffOko7zR2mZ0TKuGVldEYweWaIKZMYGvkWnzwRPL+JYz 3sdOM+/Y8wqxNYqyXTRwPY1Zq6oMs4b66G4kHFmjpDtoDJPShdvl8B3Wt07GdNY3ElIu J5yY/+nOswgZuaPSgX37OAWUk0CjfXezcHkPZ3OuavPoUxkOwQu31heBCKX4W8z7fEMM DoxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=P5Fsq2RX8/y2x9aiQTk6UToPX5ZjmTnnnnUS2+II2G4=; fh=d3q967Ss27yOZEBNWb7WV1pwIIYORDjfLhLmomzC17w=; b=XgLkIodcMDFa/nwnEf4YXAiSJPcTJ6EnA5TICz/0QLw8dI08Zziw8LinN3dupBWmaa +859ATs+dlwhyoe1hNaFh4+7uURNp6BLcA9HetkLsojNShkNDC/LkSx0B4UrOLCjFKnp qxdCYOec5iy5loGAcoRjh4vYwmrG4nfN9Y4yUkjnzenNPuMiw+avddUtJLIvVWENQBVB MOog/x+N2zN5c+UD9T2tfNnlFe++S8axh6AGlt5uFMb/HgaEN1kmS9BsCGf9KLv/U47y +O5B5eVb75bGWIxZE52qLT2ekh3Wigdky76n6jUQzw7f0qXRJAo7Nh3E/PaXLaDiZ5ln MH7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SeNa/NMf"; 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 f2-20020a056214076200b0068c4caadce8si3611112qvz.53.2024.01.29.15.37.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Jan 2024 15:37:37 -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=pass header.i=@linaro.org header.s=google header.b="SeNa/NMf"; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUb68-0005gw-8J; Mon, 29 Jan 2024 18:31:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUb5m-0005SD-6Z for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:31:09 -0500 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUb5j-00051U-2P for qemu-devel@nongnu.org; Mon, 29 Jan 2024 18:31:04 -0500 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1d8d747a3bcso11454305ad.0 for ; Mon, 29 Jan 2024 15:31:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706571062; x=1707175862; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=P5Fsq2RX8/y2x9aiQTk6UToPX5ZjmTnnnnUS2+II2G4=; b=SeNa/NMfzeruYW+HVQUkavTTiKAuX4/52RZT3dQC3bqQ3kwe9gjkeZW8+STgZ/VnAU yfT4fYHu4IrS4qVO4t0lQW3qsZdvwlStsBhnnJ61omX2sweiBfJnQLoEaVGrDY2whEnH /jfmPWEYOt550d9VPg6tZHBxi14XCer+B3tDu0ZP4E52S2leIrDOSdM/3ZSi2lNAXk5j 38RSFNN6AtK+W2ywL9KqoZZqURtEx3giLfsMHUuf4pcnQsOA4JMDYjYp8v9RQiB0Mbul /6AohlMuoTyEGSFwb2nRp76P3Vgw2JK6fNEysHxkfad5T0+6c1p16gB441attqCwGHHm wfQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706571062; x=1707175862; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P5Fsq2RX8/y2x9aiQTk6UToPX5ZjmTnnnnUS2+II2G4=; b=jeYZZSrXZ6uKdNgtVZiEB9IaCYfaGf/5D3OcuaJ6AuiDpoRUv3S2Lf8BKctjd49KmL wy85U1QMIZCAFC0xY4fnxtEqekVStMwk1/pUUY41o9FeG42Bkk2cGDByI2H28iYb0lEF Fk/k4IPt21QHLRzCAAx8U6g0dpLTWM4lr2wvs67OfnQ1bUivW/pirgzCSCMm70Vqxnf4 mEISmQpFg9whQ+jPfQsiuz2bTuPV3QJZp7VwPTb/dPWh776rhedj2DlCaNuNbacyX4NN 2BE/Jg4Mt8le0A/l6n1dBBKWgxcdk6vmhPx0wYreVKZgnc2MrWpoOyc89QdUp1c2d32G w1aQ== X-Gm-Message-State: AOJu0Yw1ID0vBaJYX4X9QvpYjmwRW+QzSnq0qYiYaoUWtIx+Le7d/0ty RZ7CwxBpTCPW52IOeSOwQwd2QFsB0bCO+jXJDQz/cAl07eC+45MTW6VBIMOC/neKNPl47p3HUJX e9VY= X-Received: by 2002:a17:902:f691:b0:1d7:5c60:f4f5 with SMTP id l17-20020a170902f69100b001d75c60f4f5mr72001plg.16.1706571061697; Mon, 29 Jan 2024 15:31:01 -0800 (PST) Received: from stoup.. ([103.210.27.218]) by smtp.gmail.com with ESMTPSA id l6-20020a170902eb0600b001d8dbb867b1sm2710591plb.179.2024.01.29.15.30.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:31:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org, anjo@rev.ng Subject: [PATCH 06/33] target/avr: Populate CPUClass.mmu_index Date: Tue, 30 Jan 2024 09:30:16 +1000 Message-Id: <20240129233043.34558-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240129233043.34558-1-richard.henderson@linaro.org> References: <20240129233043.34558-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Richard Henderson --- target/avr/cpu.h | 4 +--- target/avr/cpu.c | 6 ++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/target/avr/cpu.h b/target/avr/cpu.h index 7d5dd42575..4595c6bb18 100644 --- a/target/avr/cpu.h +++ b/target/avr/cpu.h @@ -184,9 +184,7 @@ static inline void set_avr_feature(CPUAVRState *env, int feature) env->features |= (1U << feature); } -#define cpu_mmu_index avr_cpu_mmu_index - -static inline int avr_cpu_mmu_index(CPUAVRState *env, bool ifetch) +static inline int cpu_mmu_index(CPUAVRState *env, bool ifetch) { return ifetch ? MMU_CODE_IDX : MMU_DATA_IDX; } diff --git a/target/avr/cpu.c b/target/avr/cpu.c index 1c68748b24..a40f445af2 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -50,6 +50,11 @@ static bool avr_cpu_has_work(CPUState *cs) && cpu_interrupts_enabled(env); } +static int avr_cpu_mmu_index(CPUState *cs, bool ifetch) +{ + return ifetch ? MMU_CODE_IDX : MMU_DATA_IDX; +} + static void avr_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb) { @@ -236,6 +241,7 @@ static void avr_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = avr_cpu_class_by_name; cc->has_work = avr_cpu_has_work; + cc->mmu_index = avr_cpu_mmu_index; cc->dump_state = avr_cpu_dump_state; cc->set_pc = avr_cpu_set_pc; cc->get_pc = avr_cpu_get_pc;