[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 5/9] target/mips: Restrict some system specific declarations to s
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 5/9] target/mips: Restrict some system specific declarations to sysemu |
Date: |
Thu, 17 Jun 2021 19:43:19 +0200 |
Commit 043715d1e0f ("target/mips: Update ITU to utilize SAARI
and SAAR CP0 registers") declared itc_reconfigure() in public
namespace, while it is restricted to system emulation.
Similarly commit 5679479b9a1 ("target/mips: Move CP0 helpers
to sysemu/cp0.c") restricted cpu_mips_soft_irq() definition to
system emulation, but forgot to restrict its declaration.
Commit a2b0a27d33e ("target/mips: Move TCG source files under
tcg/ sub directory") restricted mips_cpu_do_unaligned_access()
to system emulation but forgot to guard the declaration.
To avoid polluting user-mode emulation with these declarations,
restrict them to sysemu. Also restrict the sysemu ITU/ITC/IRQ
fields from CPUMIPSState.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/mips/cpu.h | 10 +++++++---
target/mips/tcg/tcg-internal.h | 6 +++---
2 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/target/mips/cpu.h b/target/mips/cpu.h
index 075c24abdad..1dfe69c6c0c 100644
--- a/target/mips/cpu.h
+++ b/target/mips/cpu.h
@@ -1152,13 +1152,13 @@ struct CPUMIPSState {
CPUMIPSMVPContext *mvp;
#if !defined(CONFIG_USER_ONLY)
CPUMIPSTLBContext *tlb;
+ void *irq[8];
+ struct MIPSITUState *itu;
+ MemoryRegion *itc_tag; /* ITC Configuration Tags */
#endif
const mips_def_t *cpu_model;
- void *irq[8];
QEMUTimer *timer; /* Internal timer */
- struct MIPSITUState *itu;
- MemoryRegion *itc_tag; /* ITC Configuration Tags */
target_ulong exception_base; /* ExceptionBase input to the core */
uint64_t cp0_count_ns; /* CP0_Count clock period (in nanoseconds) */
};
@@ -1316,12 +1316,16 @@ uint64_t cpu_mips_phys_to_kseg1(void *opaque, uint64_t
addr);
bool mips_um_ksegs_enabled(void);
void mips_um_ksegs_enable(void);
+#if !defined(CONFIG_USER_ONLY)
+
/* mips_int.c */
void cpu_mips_soft_irq(CPUMIPSState *env, int irq, int level);
/* mips_itu.c */
void itc_reconfigure(struct MIPSITUState *tag);
+#endif /* !CONFIG_USER_ONLY */
+
/* helper.c */
target_ulong exception_resume_pc(CPUMIPSState *env);
diff --git a/target/mips/tcg/tcg-internal.h b/target/mips/tcg/tcg-internal.h
index 81b14eb219e..11d98a717f2 100644
--- a/target/mips/tcg/tcg-internal.h
+++ b/target/mips/tcg/tcg-internal.h
@@ -23,9 +23,6 @@ bool mips_cpu_exec_interrupt(CPUState *cpu, int int_req);
bool mips_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
MMUAccessType access_type, int mmu_idx,
bool probe, uintptr_t retaddr);
-void mips_cpu_do_unaligned_access(CPUState *cpu, vaddr addr,
- MMUAccessType access_type,
- int mmu_idx, uintptr_t retaddr);
const char *mips_exception_name(int32_t exception);
@@ -57,6 +54,9 @@ void mips_cpu_do_transaction_failed(CPUState *cs, hwaddr
physaddr,
MMUAccessType access_type,
int mmu_idx, MemTxAttrs attrs,
MemTxResult response, uintptr_t retaddr);
+void mips_cpu_do_unaligned_access(CPUState *cpu, vaddr addr,
+ MMUAccessType access_type,
+ int mmu_idx, uintptr_t retaddr);
void cpu_mips_tlb_flush(CPUMIPSState *env);
#endif /* !CONFIG_USER_ONLY */
--
2.31.1
- [PATCH 0/9] target/mips: Various fixes & cleanups, Philippe Mathieu-Daudé, 2021/06/17
- [PATCH 1/9] target/mips: Do not abort on invalid instruction, Philippe Mathieu-Daudé, 2021/06/17
- [PATCH 2/9] target/mips: Fix more TCG temporary leaks in gen_pool32a5_nanomips_insn, Philippe Mathieu-Daudé, 2021/06/17
- [PATCH 3/9] target/mips: Move TCG trace events to tcg/ sub directory, Philippe Mathieu-Daudé, 2021/06/17
- [PATCH 4/9] target/mips: Move translate.h to tcg/ sub directory, Philippe Mathieu-Daudé, 2021/06/17
- [PATCH 5/9] target/mips: Restrict some system specific declarations to sysemu,
Philippe Mathieu-Daudé <=
- [PATCH 6/9] target/mips: Remove SmartMIPS / MDMX unuseful comments, Philippe Mathieu-Daudé, 2021/06/17
- [PATCH 7/9] target/mips: Remove microMIPS BPOSGE32 / BPOSGE64 unuseful cases, Philippe Mathieu-Daudé, 2021/06/17
- [PATCH 8/9] target/mips: Constify host_to_mips_errno[], Philippe Mathieu-Daudé, 2021/06/17
- [PATCH 9/9] target/mips: Optimize regnames[] arrays, Philippe Mathieu-Daudé, 2021/06/17