Skip to content

Commit 250ae6d

Browse files
philmdrth7680
authored andcommitted
target/openrisc: 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 dabfe13 commit 250ae6d

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

target/openrisc/cpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ static const struct SysemuCPUOps openrisc_sysemu_ops = {
186186

187187
static const struct TCGCPUOps openrisc_tcg_ops = {
188188
.initialize = openrisc_translate_init,
189-
.cpu_exec_interrupt = openrisc_cpu_exec_interrupt,
190189
.tlb_fill = openrisc_cpu_tlb_fill,
191190

192191
#ifndef CONFIG_USER_ONLY
192+
.cpu_exec_interrupt = openrisc_cpu_exec_interrupt,
193193
.do_interrupt = openrisc_cpu_do_interrupt,
194194
#endif /* !CONFIG_USER_ONLY */
195195
};

target/openrisc/cpu.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,6 @@ struct OpenRISCCPU {
312312

313313

314314
void cpu_openrisc_list(void);
315-
void openrisc_cpu_do_interrupt(CPUState *cpu);
316-
bool openrisc_cpu_exec_interrupt(CPUState *cpu, int int_req);
317315
void openrisc_cpu_dump_state(CPUState *cpu, FILE *f, int flags);
318316
hwaddr openrisc_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
319317
int openrisc_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg);
@@ -331,6 +329,9 @@ int print_insn_or1k(bfd_vma addr, disassemble_info *info);
331329
#ifndef CONFIG_USER_ONLY
332330
extern const VMStateDescription vmstate_openrisc_cpu;
333331

332+
void openrisc_cpu_do_interrupt(CPUState *cpu);
333+
bool openrisc_cpu_exec_interrupt(CPUState *cpu, int int_req);
334+
334335
/* hw/openrisc_pic.c */
335336
void cpu_openrisc_pic_init(OpenRISCCPU *cpu);
336337

target/openrisc/interrupt.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
void openrisc_cpu_do_interrupt(CPUState *cs)
3030
{
31-
#ifndef CONFIG_USER_ONLY
3231
OpenRISCCPU *cpu = OPENRISC_CPU(cs);
3332
CPUOpenRISCState *env = &cpu->env;
3433
int exception = cs->exception_index;
@@ -96,7 +95,6 @@ void openrisc_cpu_do_interrupt(CPUState *cs)
9695
} else {
9796
cpu_abort(cs, "Unhandled exception 0x%x\n", exception);
9897
}
99-
#endif
10098

10199
cs->exception_index = -1;
102100
}

target/openrisc/meson.build

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,17 @@ openrisc_ss.add(files(
99
'exception_helper.c',
1010
'fpu_helper.c',
1111
'gdbstub.c',
12-
'interrupt.c',
1312
'interrupt_helper.c',
1413
'mmu.c',
1514
'sys_helper.c',
1615
'translate.c',
1716
))
1817

1918
openrisc_softmmu_ss = ss.source_set()
20-
openrisc_softmmu_ss.add(files('machine.c'))
19+
openrisc_softmmu_ss.add(files(
20+
'interrupt.c',
21+
'machine.c',
22+
))
2123

2224
target_arch += {'openrisc': openrisc_ss}
2325
target_softmmu_arch += {'openrisc': openrisc_softmmu_ss}

0 commit comments

Comments
 (0)