From nobody Fri Oct 18 08:32:19 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1721952578; cv=none; d=zohomail.com; s=zohoarc; b=A8OLaeb9IcX21ADEtonaA20igecE9M1513IEtz/NtItdunetFMq+t/dAvW4FrPdbXoFBRShvQex5p0MYHbkmuFtbFRcXUWNy2Eo9SzykUB+3Ybqhe2ECH+V/x73VUsqUN0T/4GCDaWHC7tGYrLXLZNQa3/BI24SG/KVF3H/Gjao= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1721952578; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iKp6OWilW+wJjA8X4BcH+9kkT2W9skS4KPMDra0yBgg=; b=D7eNJDyJu5PIetFQ0AOHS4FRuT0QymTj9USM6v6zvEIRxMBIsNwHo7FB0cF3d0Fk3beE8gjhOTzmnZK7ej9e0fDFcsyqBhnhazUfiFQODPmlGvAsRj7coAx8UwFhjypqveXohj2+StCyjLCXctdZ+qm8iNosSrfSgaBTMz5y4pw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1721952578023668.4853241125295; Thu, 25 Jul 2024 17:09:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sX8NG-0006Ka-62; Thu, 25 Jul 2024 19:59:55 -0400 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 1sX8Mv-0004V2-Ja; Thu, 25 Jul 2024 19:59:34 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sX8Mt-0001lj-Pl; Thu, 25 Jul 2024 19:59:33 -0400 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-2cb53da06a9so271973a91.0; Thu, 25 Jul 2024 16:59:30 -0700 (PDT) Received: from wheely.local0.net ([203.220.44.216]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2cf28c7fef3sm2142060a91.16.2024.07.25.16.59.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 16:59:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721951969; x=1722556769; 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=iKp6OWilW+wJjA8X4BcH+9kkT2W9skS4KPMDra0yBgg=; b=e/4BWfkmxwIOPYS6J3SH+8Vz2zUsplGm3Wl78ZihHDUhZQktrZ98IJohepbfhxEnpB 7qBSHPENktO7uDbCY6uXKvLwDmhhMPhZw97N/OZSSBu7YVA1uYaEFFLldDq6kYTP1N/U cguznqUUgtPiHZCWvKyYiHtOg/fnxlvhUtsfgjGgolKY19S77eGDoajYcRae9gOD/fM1 LYB1IX+ke1pULyRhWHwOPdo+xtdWEZsx3ydHzEULf9/URJAG5gx/UArDizxHxyJsx2Jp 6jwR8eoMWVaQOV8tw1hkFspj/xHEDP5C61LOR6lCyBr/DdrdG6DO2qQtGPbM811/H81z Ueig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721951969; x=1722556769; 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=iKp6OWilW+wJjA8X4BcH+9kkT2W9skS4KPMDra0yBgg=; b=Xa+3h0WyPv0nv/fWbctACWeL3ZtV/epxlv5vlripZDwmrBVjj4e61H0QFlQiks3CxX HI28t3YJhTgDS8uKluO1DJGjVl716hbBYO0/WEDrBBX+cHyD5XZ4eBXgW2ALzHGRVZGS 2sgUaueVsJYwQZs6/8tLFhW9EdnxMBbN2in+N3gGGUAjZiqT3P/ND5jyJNcJOqCSfouP R5NAmIkHzWBFYh0GMK041nhJO5yb/ZTl+fFJq1Add4PMIqRp09qFgUdNP2ykMP4J+vY8 HHyynX5JcXBkesbCXaTctCMHu9OwWxbAhQ7IGI0sRp2QABtzedlqdRbb9VFkes0lHW3u DbGg== X-Forwarded-Encrypted: i=1; AJvYcCUNcUUVj8QXlcmyOmpfkq3a1aidWvtGOQDzyjDL8qV4QKjKASUxgV7Nhok+0GG5YwkvibGIZeqs0hDLyKmti+YuyiLv X-Gm-Message-State: AOJu0YzajxjDLtZHsT2yjj0eDUwXhOJ8fs7PMoP3Q+cHjK5/Gy7ivn2l vjnVRJTZB0t2n3zDY9MX3fUrvFgBPoZiyEKZmG3WjpGWk+josut2/3OY9g== X-Google-Smtp-Source: AGHT+IEt3THaTvhfarD4zGysFpzBT4BZIlSHNB4j3Kf3bLXopURVKz3wkBKKsXQOTHEyyWA7Tj+3KA== X-Received: by 2002:a17:90a:f190:b0:2c9:90fa:b9f8 with SMTP id 98e67ed59e1d1-2cf216586e5mr7365299a91.10.1721951969558; Thu, 25 Jul 2024 16:59:29 -0700 (PDT) From: Nicholas Piggin To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-ppc@nongnu.org, BALATON Zoltan Subject: [PULL 88/96] target/ppc/mmu_common.c: Use defines instead of numeric constants Date: Fri, 26 Jul 2024 09:54:01 +1000 Message-ID: <20240725235410.451624-89-npiggin@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240725235410.451624-1-npiggin@gmail.com> References: <20240725235410.451624-1-npiggin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=npiggin@gmail.com; helo=mail-pj1-x102f.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, FREEMAIL_FROM=0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1721952578308116600 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan Replace some BAT related constants with defines from mmu-hash32.h Signed-off-by: BALATON Zoltan Reviewed-by: Nicholas Piggin Signed-off-by: Nicholas Piggin --- target/ppc/mmu_common.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/target/ppc/mmu_common.c b/target/ppc/mmu_common.c index 110936ca83..aa002bba35 100644 --- a/target/ppc/mmu_common.c +++ b/target/ppc/mmu_common.c @@ -201,7 +201,7 @@ static inline void bat_size_prot(CPUPPCState *env, targ= et_ulong *blp, target_ulong bl; int pp, valid, prot; =20 - bl =3D (*BATu & 0x00001FFC) << 15; + bl =3D (*BATu & BATU32_BL) << 15; valid =3D 0; prot =3D 0; if ((!FIELD_EX64(env->msr, MSR, PR) && (*BATu & 0x00000002)) || @@ -241,19 +241,19 @@ static int get_bat_6xx_tlb(CPUPPCState *env, mmu_ctx_= t *ctx, for (i =3D 0; i < env->nb_BATs; i++) { BATu =3D &BATut[i]; BATl =3D &BATlt[i]; - BEPIu =3D *BATu & 0xF0000000; - BEPIl =3D *BATu & 0x0FFE0000; + BEPIu =3D *BATu & BATU32_BEPIU; + BEPIl =3D *BATu & BATU32_BEPIL; bat_size_prot(env, &bl, &valid, &prot, BATu, BATl); qemu_log_mask(CPU_LOG_MMU, "%s: %cBAT%d v " TARGET_FMT_lx " BATu " TARGET_FMT_lx " BATl " TARGET_FMT_lx "\n", __func__, ifetch ? 'I' : 'D', i, eaddr, *BATu, *BATl); - if ((eaddr & 0xF0000000) =3D=3D BEPIu && - ((eaddr & 0x0FFE0000) & ~bl) =3D=3D BEPIl) { + if ((eaddr & BATU32_BEPIU) =3D=3D BEPIu && + ((eaddr & BATU32_BEPIL) & ~bl) =3D=3D BEPIl) { /* BAT matches */ if (valid !=3D 0) { /* Get physical address */ - ctx->raddr =3D (*BATl & 0xF0000000) | - ((eaddr & 0x0FFE0000 & bl) | (*BATl & 0x0FFE0000)) | + ctx->raddr =3D (*BATl & BATU32_BEPIU) | + ((eaddr & BATU32_BEPIL & bl) | (*BATl & BATU32_BEPIL))= | (eaddr & 0x0001F000); /* Compute access rights */ ctx->prot =3D prot; @@ -277,9 +277,9 @@ static int get_bat_6xx_tlb(CPUPPCState *env, mmu_ctx_t = *ctx, for (i =3D 0; i < 4; i++) { BATu =3D &BATut[i]; BATl =3D &BATlt[i]; - BEPIu =3D *BATu & 0xF0000000; - BEPIl =3D *BATu & 0x0FFE0000; - bl =3D (*BATu & 0x00001FFC) << 15; + BEPIu =3D *BATu & BATU32_BEPIU; + BEPIl =3D *BATu & BATU32_BEPIL; + bl =3D (*BATu & BATU32_BL) << 15; qemu_log_mask(CPU_LOG_MMU, "%s: %cBAT%d v " TARGET_FMT_lx " BATu " TARGET_FMT_lx " BATl " TARGET_FMT_lx "\n\t" TARGET_FMT_lx " " TARGET_FMT_lx " " @@ -520,9 +520,9 @@ static void mmu6xx_dump_BATs(CPUPPCState *env, int type) for (i =3D 0; i < env->nb_BATs; i++) { BATu =3D &BATut[i]; BATl =3D &BATlt[i]; - BEPIu =3D *BATu & 0xF0000000; - BEPIl =3D *BATu & 0x0FFE0000; - bl =3D (*BATu & 0x00001FFC) << 15; + BEPIu =3D *BATu & BATU32_BEPIU; + BEPIl =3D *BATu & BATU32_BEPIL; + bl =3D (*BATu & BATU32_BL) << 15; qemu_printf("%s BAT%d BATu " TARGET_FMT_lx " BATl " TARGET_FMT_lx "\n\t" TARGET_FMT_lx " " TARGET_FMT_lx " " TARGET_FMT_lx "\n", --=20 2.45.2