[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-9.1 10/21] target/nios2: Prefix MMU API with 'nios2_'
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH-for-9.1 10/21] target/nios2: Prefix MMU API with 'nios2_' |
Date: |
Thu, 21 Mar 2024 16:48:26 +0100 |
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é <philmd@linaro.org>
---
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;
--
2.41.0
- Re: [PATCH-for-9.1 04/21] target/i386: Extract x86_dump_mmu() from hmp_info_tlb(), (continued)
- [PATCH-for-9.1 05/21] target/m68k: Replace qemu_printf() by monitor_printf() in monitor, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 06/21] target/m68k: Have dump_ttr() take a @description argument, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 07/21] target/m68k: Move MMU monitor commands from helper.c to monitor.c, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 08/21] target/microblaze: Prefix MMU API with 'mb_', Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 09/21] target/mips: Prefix MMU API with 'mips_', Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 10/21] target/nios2: Prefix MMU API with 'nios2_',
Philippe Mathieu-Daudé <=
- [PATCH-for-9.1 11/21] target/nios2: Move monitor commands to monitor.c, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 12/21] target/nios2: Replace qemu_printf() by monitor_printf() in monitor, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 13/21] target/ppc: Replace qemu_printf() by monitor_printf() in monitor, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 14/21] target/sh4: Extract sh4_dump_mmu() from hmp_info_tlb(), Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.0? 15/21] target/sparc: Fix string format errors when DEBUG_MMU is defined, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 16/21] target/sparc: Replace qemu_printf() by monitor_printf() in monitor, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 17/21] target/xtensa: Prefix MMU API with 'xtensa_', Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 21/21] target/xtensa: Replace qemu_printf() by monitor_printf() in monitor, Philippe Mathieu-Daudé, 2024/03/21
- [PATCH-for-9.1 18/21] target/xtensa: Extract MMU API to new mmu.c/mmu.h files, Philippe Mathieu-Daudé, 2024/03/21