From patchwork Thu Mar 21 15:48:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 781570 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:33e:7753:30bd with SMTP id o1csp900620wrj; Thu, 21 Mar 2024 08:50:52 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVA4t0N6Hf2CkXa+7AGMUH0LBHcvnTdlOsZtTbYPCR7woJdrPrK0OLt6Qqceu7pm/j9LCGopQB0D5rt82AIOjmN X-Google-Smtp-Source: AGHT+IFns9HSW5aWJ4GD1//Q1ziefJsAFGX1oEOpYFuV3BI+FxeKIK03qqSr7uc0QhOVBXKT9ZGt X-Received: by 2002:a05:651c:1a0b:b0:2d4:9873:dc2d with SMTP id by11-20020a05651c1a0b00b002d49873dc2dmr4212425ljb.17.1711036252629; Thu, 21 Mar 2024 08:50:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711036252; cv=none; d=google.com; s=arc-20160816; b=g84ChOrJATEaYJATeayiUy1E5z65aM5k0/FMA9fOvRyAIT4JI8cPTaDnIhDXYNaxPb WkXz7bD+UiaTLkIp0dViBDMud13pICrKlrGYUVwjbQ9dj02OGlx//tihxhdTczZlfHIZ r+9LL8wPZ8EhmCaEfYKdcozDzWFKS1rOjlLZhPRAL7TT451T94yzY59TJLB7xFt7DVw6 +qGqQjW5dK8UINzhVBhrPwDhl6zMQYOMfM2JcDTwy+5XRn2sKYUCzl+rwJ9KDbXOAPZr tXzMCU+LqnJXy9f9mLmQi/yKycez+2U7EZRiuBjftEC/c1EcMaQ9yKc69uw5EsRg1nx1 hFew== 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=QNyIdceODiq/qXWOadWFMGnL31bcMZmdSI8jHE35wz0=; fh=T6rKnw5qbXdIf08MbaczezOCfCSVJgQaY05KIUhs/sE=; b=tpuwD/W+kWxZoDVzykVypPxIShPCbGFM1+dtlDLm81LwLwjI6Z7OtbBaf/PI9gyr27 5iOQ+SI2o3c3DMFOmiC3lkt4STagPDwR6/u3LPiM9RmE9xvwEP7HxKZItP6Rs801VzN2 OXgI3tomJmPK6qu+gjFhPil0WojO4dYMMI4DJdLD8GNDPofF6qLqRYAbw+0nExU11uUb sYmphpr/3dQS91fGSPdZKfzl+7jmSQdI43fMOV3ecp0gWkvnZcECCIRtwEtbLzvh5dgN lge1rNo8fjLI70o0MUQx3PGDuJ/BVjMFWtfIChUDN+wGhZGHfPpYCj7+U/dovopm6opL mzbQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Smq9a7zf; 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 c7-20020a5d63c7000000b0033e77b4f0dcsi8580586wrw.577.2024.03.21.08.50.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 Mar 2024 08:50:52 -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=Smq9a7zf; 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 1rnKgC-0006wv-5Y; Thu, 21 Mar 2024 11:50:08 -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 1rnKg9-0006uB-E5 for qemu-devel@nongnu.org; Thu, 21 Mar 2024 11:50:05 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rnKg5-0001WM-Io for qemu-devel@nongnu.org; Thu, 21 Mar 2024 11:50:04 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-414689ba80eso9363545e9.2 for ; Thu, 21 Mar 2024 08:50:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711036200; x=1711641000; 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=QNyIdceODiq/qXWOadWFMGnL31bcMZmdSI8jHE35wz0=; b=Smq9a7zfKTqK+KhZXshSHRabhcw0GtHOyVn4Z/GJUMC/E+Qckk4GtJ8g7cTvQXwmSI BxwLKPD5NDmBzCJgXgStUdjEM/UeWsT2jSwYHkXsMIeEYTnr9/tGvJqvLHZPIaWrlOQK twgLZAUbzroHkMLG+Qv6uwNV7q5AQL58sZ7OY8IHsNkpAIqujiiDaqkhIkI1Uyy4K8OO iZBAcJfQQspILjhhQr3bdG8/AegAxO5egpoxDlEP1kJBkNVzhZKlOspCWund8PBW+ZXT stTUpYc5usgkzAZW+Sfw9qodR56lqCHW0mMQgjHZKs12AQyCePnWL50KpRwSjFRD/+yS Ibsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711036200; x=1711641000; 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=QNyIdceODiq/qXWOadWFMGnL31bcMZmdSI8jHE35wz0=; b=IrWLXTrECYDREiZWUG1phDpm0r1cvUGI0HnCPGrkWZXYmTfqnZV2APuk9BlJ2RzBtx FLILgTxqKsgE5vWVY+wauChFesihH+oTQBAEYF9ijTqVWEK0Xp8SGlwrgRbd6jU3n9pp PmHDJCD6TQOIBsb8YwdTkmSEt2UqCfBbqNxxs1xJmz304oqxgLOeLyYE9rxbe4M6HuB3 v84fenbTkSxuM7mliCNo+zEd6hXMaVviipuuma3MmZlWI0fTs3YzAopij4fRow6FvGcm nCNVSitoVR/UUGD+4KHTNNwWG7RMsAjCO0v5f/BrfY4nch2Ayqwd9d7Z5kJw8c63cN8h jg1A== X-Gm-Message-State: AOJu0YwXUVMPeCnHDf7l0eYNUrS8SJkHaFPfusEVbJj3VC9obpMjkfi7 NOfTIW0CKaPBv5r1quFhFIQ2g0g6ILv9sLeLBkvRFpWkPCsKPnK02cAufFiT4Mqtp8c/FUKh0wh tn6Q= X-Received: by 2002:a05:600c:3b90:b0:413:2f8e:dd0b with SMTP id n16-20020a05600c3b9000b004132f8edd0bmr4127988wms.26.1711036199798; Thu, 21 Mar 2024 08:49:59 -0700 (PDT) Received: from m1x-phil.lan ([176.187.206.222]) by smtp.gmail.com with ESMTPSA id q18-20020adff792000000b0033ec9b26b7asm17495211wrp.25.2024.03.21.08.49.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 21 Mar 2024 08:49:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Artyom Tarasenko , Chris Wulff , "Edgar E. Iglesias" , Marek Vasut , Max Filippov , "Dr . David Alan Gilbert" , Jiaxun Yang , Nicholas Piggin , Paolo Bonzini , Daniel Henrique Barboza , Yoshinori Sato , Markus Armbruster , Richard Henderson , qemu-ppc@nongnu.org, Laurent Vivier , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH-for-9.1 10/21] target/nios2: Prefix MMU API with 'nios2_' Date: Thu, 21 Mar 2024 16:48:26 +0100 Message-ID: <20240321154838.95771-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240321154838.95771-1-philmd@linaro.org> References: <20240321154838.95771-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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.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 Nios2 MMU API is exposed in "mmu.h". In order to avoid name clashing with other targets, prefix the API with 'nios2_'. Signed-off-by: Philippe Mathieu-Daudé --- target/nios2/mmu.h | 11 +++++------ target/nios2/cpu.c | 2 +- target/nios2/helper.c | 4 ++-- target/nios2/mmu.c | 7 +++---- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/target/nios2/mmu.h b/target/nios2/mmu.h index 5b085900fb..5b16a5facf 100644 --- a/target/nios2/mmu.h +++ b/target/nios2/mmu.h @@ -42,11 +42,10 @@ typedef struct Nios2MMULookup { int prot; } Nios2MMULookup; -void mmu_flip_um(CPUNios2State *env, unsigned int um); -unsigned int mmu_translate(CPUNios2State *env, - Nios2MMULookup *lu, - target_ulong vaddr, int rw, int mmu_idx); -void mmu_write(CPUNios2State *env, uint32_t rn, uint32_t v); -void mmu_init(CPUNios2State *env); +void nios2_mmu_flip_um(CPUNios2State *env, unsigned int um); +unsigned int nios2_mmu_translate(CPUNios2State *env, Nios2MMULookup *lu, + target_ulong vaddr, int rw, int mmu_idx); +void nios2_mmu_write(CPUNios2State *env, uint32_t rn, uint32_t v); +void nios2_mmu_init(CPUNios2State *env); #endif /* NIOS2_MMU_H */ diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index 679aff5730..d2a9a0d4f1 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -113,7 +113,7 @@ static void nios2_cpu_initfn(Object *obj) #if !defined(CONFIG_USER_ONLY) Nios2CPU *cpu = NIOS2_CPU(obj); - mmu_init(&cpu->env); + nios2_mmu_init(&cpu->env); #endif } diff --git a/target/nios2/helper.c b/target/nios2/helper.c index ac57121afc..2b6bdfbc55 100644 --- a/target/nios2/helper.c +++ b/target/nios2/helper.c @@ -268,7 +268,7 @@ hwaddr nios2_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) unsigned int hit; if (cpu->mmu_present && (addr < 0xC0000000)) { - hit = mmu_translate(env, &lu, addr, 0, 0); + hit = nios2_mmu_translate(env, &lu, addr, 0, 0); if (hit) { vaddr = addr & TARGET_PAGE_MASK; paddr = lu.paddr + vaddr - lu.vaddr; @@ -335,7 +335,7 @@ bool nios2_cpu_tlb_fill(CPUState *cs, vaddr address, int size, } /* Virtual page. */ - hit = mmu_translate(env, &lu, address, access_type, mmu_idx); + hit = nios2_mmu_translate(env, &lu, address, access_type, mmu_idx); if (hit) { vaddr = address & TARGET_PAGE_MASK; paddr = lu.paddr + vaddr - lu.vaddr; diff --git a/target/nios2/mmu.c b/target/nios2/mmu.c index d9b690b78e..272bd9fc6a 100644 --- a/target/nios2/mmu.c +++ b/target/nios2/mmu.c @@ -28,9 +28,8 @@ /* rw - 0 = read, 1 = write, 2 = fetch. */ -unsigned int mmu_translate(CPUNios2State *env, - Nios2MMULookup *lu, - target_ulong vaddr, int rw, int mmu_idx) +unsigned int nios2_mmu_translate(CPUNios2State *env, Nios2MMULookup *lu, + target_ulong vaddr, int rw, int mmu_idx) { Nios2CPU *cpu = env_archcpu(env); int pid = FIELD_EX32(env->mmu.tlbmisc_wr, CR_TLBMISC, PID); @@ -180,7 +179,7 @@ void helper_mmu_write_pteaddr(CPUNios2State *env, uint32_t v) env->mmu.pteaddr_wr = v; } -void mmu_init(CPUNios2State *env) +void nios2_mmu_init(CPUNios2State *env) { Nios2CPU *cpu = env_archcpu(env); Nios2MMU *mmu = &env->mmu;