[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 19/24] target/sh4: Restrict cpu_exec_interrupt() handler to sy
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v3 19/24] target/sh4: Restrict cpu_exec_interrupt() handler to sysemu |
Date: |
Sat, 11 Sep 2021 18:54:29 +0200 |
Restrict cpu_exec_interrupt() and its callees to sysemu.
Reviewed-by: Warner Losh <imp@bsdimp.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
target/sh4/cpu.h | 4 ++--
target/sh4/cpu.c | 2 +-
target/sh4/helper.c | 9 ++-------
3 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/target/sh4/cpu.h b/target/sh4/cpu.h
index 01c43440822..017a7702140 100644
--- a/target/sh4/cpu.h
+++ b/target/sh4/cpu.h
@@ -204,8 +204,6 @@ struct SuperHCPU {
};
-void superh_cpu_do_interrupt(CPUState *cpu);
-bool superh_cpu_exec_interrupt(CPUState *cpu, int int_req);
void superh_cpu_dump_state(CPUState *cpu, FILE *f, int flags);
hwaddr superh_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
int superh_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg);
@@ -223,6 +221,8 @@ bool superh_cpu_tlb_fill(CPUState *cs, vaddr address, int
size,
void sh4_cpu_list(void);
#if !defined(CONFIG_USER_ONLY)
+void superh_cpu_do_interrupt(CPUState *cpu);
+bool superh_cpu_exec_interrupt(CPUState *cpu, int int_req);
void cpu_sh4_invalidate_tlb(CPUSH4State *s);
uint32_t cpu_sh4_read_mmaped_itlb_addr(CPUSH4State *s,
hwaddr addr);
diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c
index 83269229421..2047742d03c 100644
--- a/target/sh4/cpu.c
+++ b/target/sh4/cpu.c
@@ -236,10 +236,10 @@ static const struct SysemuCPUOps sh4_sysemu_ops = {
static const struct TCGCPUOps superh_tcg_ops = {
.initialize = sh4_translate_init,
.synchronize_from_tb = superh_cpu_synchronize_from_tb,
- .cpu_exec_interrupt = superh_cpu_exec_interrupt,
.tlb_fill = superh_cpu_tlb_fill,
#ifndef CONFIG_USER_ONLY
+ .cpu_exec_interrupt = superh_cpu_exec_interrupt,
.do_interrupt = superh_cpu_do_interrupt,
.do_unaligned_access = superh_cpu_do_unaligned_access,
.io_recompile_replay_branch = superh_io_recompile_replay_branch,
diff --git a/target/sh4/helper.c b/target/sh4/helper.c
index 2d622081e85..53cb9c3b631 100644
--- a/target/sh4/helper.c
+++ b/target/sh4/helper.c
@@ -45,11 +45,6 @@
#if defined(CONFIG_USER_ONLY)
-void superh_cpu_do_interrupt(CPUState *cs)
-{
- cs->exception_index = -1;
-}
-
int cpu_sh4_is_cached(CPUSH4State *env, target_ulong addr)
{
/* For user mode, only U0 area is cacheable. */
@@ -784,8 +779,6 @@ int cpu_sh4_is_cached(CPUSH4State * env, target_ulong addr)
return 0;
}
-#endif
-
bool superh_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
{
if (interrupt_request & CPU_INTERRUPT_HARD) {
@@ -803,6 +796,8 @@ bool superh_cpu_exec_interrupt(CPUState *cs, int
interrupt_request)
return false;
}
+#endif /* !CONFIG_USER_ONLY */
+
bool superh_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
MMUAccessType access_type, int mmu_idx,
bool probe, uintptr_t retaddr)
--
2.31.1
- [PATCH v3 09/24] target/hppa: Restrict cpu_exec_interrupt() handler to sysemu, (continued)
- [PATCH v3 09/24] target/hppa: Restrict cpu_exec_interrupt() handler to sysemu, Philippe Mathieu-Daudé, 2021/09/11
- [PATCH v3 10/24] target/i386: Restrict cpu_exec_interrupt() handler to sysemu, Philippe Mathieu-Daudé, 2021/09/11
- [PATCH v3 11/24] target/i386: Move x86_cpu_exec_interrupt() under sysemu/ folder, Philippe Mathieu-Daudé, 2021/09/11
- [PATCH v3 12/24] target/m68k: Restrict cpu_exec_interrupt() handler to sysemu, Philippe Mathieu-Daudé, 2021/09/11
- [PATCH v3 13/24] target/microblaze: Restrict cpu_exec_interrupt() handler to sysemu, Philippe Mathieu-Daudé, 2021/09/11
- [PATCH v3 14/24] target/mips: Restrict cpu_exec_interrupt() handler to sysemu, Philippe Mathieu-Daudé, 2021/09/11
- [PATCH v3 15/24] target/nios2: Restrict cpu_exec_interrupt() handler to sysemu, Philippe Mathieu-Daudé, 2021/09/11
- [PATCH v3 16/24] target/openrisc: Restrict cpu_exec_interrupt() handler to sysemu, Philippe Mathieu-Daudé, 2021/09/11
- [PATCH v3 17/24] target/ppc: Restrict cpu_exec_interrupt() handler to sysemu, Philippe Mathieu-Daudé, 2021/09/11
- [PATCH v3 18/24] target/riscv: Restrict cpu_exec_interrupt() handler to sysemu, Philippe Mathieu-Daudé, 2021/09/11
- [PATCH v3 19/24] target/sh4: Restrict cpu_exec_interrupt() handler to sysemu,
Philippe Mathieu-Daudé <=
- [PATCH v3 20/24] target/sparc: Restrict cpu_exec_interrupt() handler to sysemu, Philippe Mathieu-Daudé, 2021/09/11
- [PATCH v3 21/24] target/rx: Restrict cpu_exec_interrupt() handler to sysemu, Philippe Mathieu-Daudé, 2021/09/11
- [PATCH v3 22/24] target/xtensa: Restrict cpu_exec_interrupt() handler to sysemu, Philippe Mathieu-Daudé, 2021/09/11
- [PATCH v3 23/24] accel/tcg: Restrict TCGCPUOps::cpu_exec_interrupt() to sysemu, Philippe Mathieu-Daudé, 2021/09/11
- [PATCH v3 24/24] user: Remove cpu_get_pic_interrupt() stubs, Philippe Mathieu-Daudé, 2021/09/11
- Re: [PATCH v3 00/24] accel/tcg: Restrict TCGCPUOps::cpu_exec_interrupt() to sysemu, Richard Henderson, 2021/09/12