Skip to content

Commit 73166ca

Browse files
philmdrth7680
authored andcommitted
target/sh4: Restrict cpu_exec_interrupt() handler to sysemu
Restrict cpu_exec_interrupt() and its callees to sysemu. Signed-off-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Warner Losh <[email protected]> Reviewed-by: Richard Henderson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Richard Henderson <[email protected]>
1 parent 17b3c35 commit 73166ca

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

target/sh4/cpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,10 @@ static const struct SysemuCPUOps sh4_sysemu_ops = {
236236
static const struct TCGCPUOps superh_tcg_ops = {
237237
.initialize = sh4_translate_init,
238238
.synchronize_from_tb = superh_cpu_synchronize_from_tb,
239-
.cpu_exec_interrupt = superh_cpu_exec_interrupt,
240239
.tlb_fill = superh_cpu_tlb_fill,
241240

242241
#ifndef CONFIG_USER_ONLY
242+
.cpu_exec_interrupt = superh_cpu_exec_interrupt,
243243
.do_interrupt = superh_cpu_do_interrupt,
244244
.do_unaligned_access = superh_cpu_do_unaligned_access,
245245
.io_recompile_replay_branch = superh_io_recompile_replay_branch,

target/sh4/cpu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,6 @@ struct SuperHCPU {
204204
};
205205

206206

207-
void superh_cpu_do_interrupt(CPUState *cpu);
208-
bool superh_cpu_exec_interrupt(CPUState *cpu, int int_req);
209207
void superh_cpu_dump_state(CPUState *cpu, FILE *f, int flags);
210208
hwaddr superh_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
211209
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,
223221

224222
void sh4_cpu_list(void);
225223
#if !defined(CONFIG_USER_ONLY)
224+
void superh_cpu_do_interrupt(CPUState *cpu);
225+
bool superh_cpu_exec_interrupt(CPUState *cpu, int int_req);
226226
void cpu_sh4_invalidate_tlb(CPUSH4State *s);
227227
uint32_t cpu_sh4_read_mmaped_itlb_addr(CPUSH4State *s,
228228
hwaddr addr);

target/sh4/helper.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@
4545

4646
#if defined(CONFIG_USER_ONLY)
4747

48-
void superh_cpu_do_interrupt(CPUState *cs)
49-
{
50-
cs->exception_index = -1;
51-
}
52-
5348
int cpu_sh4_is_cached(CPUSH4State *env, target_ulong addr)
5449
{
5550
/* For user mode, only U0 area is cacheable. */
@@ -784,8 +779,6 @@ int cpu_sh4_is_cached(CPUSH4State * env, target_ulong addr)
784779
return 0;
785780
}
786781

787-
#endif
788-
789782
bool superh_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
790783
{
791784
if (interrupt_request & CPU_INTERRUPT_HARD) {
@@ -803,6 +796,8 @@ bool superh_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
803796
return false;
804797
}
805798

799+
#endif /* !CONFIG_USER_ONLY */
800+
806801
bool superh_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
807802
MMUAccessType access_type, int mmu_idx,
808803
bool probe, uintptr_t retaddr)

0 commit comments

Comments
 (0)