qemu-riscv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 08/24] target/avr: Restrict cpu_exec_interrupt() handler to sysem


From: Philippe Mathieu-Daudé
Subject: [PATCH 08/24] target/avr: Restrict cpu_exec_interrupt() handler to sysemu
Date: Thu, 2 Sep 2021 17:16:59 +0200

Restrict cpu_exec_interrupt() and its callees to sysemu.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/avr/cpu.h    | 2 ++
 target/avr/cpu.c    | 2 +-
 target/avr/helper.c | 2 ++
 3 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/target/avr/cpu.h b/target/avr/cpu.h
index 93e3faa0a98..6f8c0ffd770 100644
--- a/target/avr/cpu.h
+++ b/target/avr/cpu.h
@@ -156,8 +156,10 @@ typedef struct AVRCPU {
 
 extern const struct VMStateDescription vms_avr_cpu;
 
+#ifndef CONFIG_USER_ONLY
 void avr_cpu_do_interrupt(CPUState *cpu);
 bool avr_cpu_exec_interrupt(CPUState *cpu, int int_req);
+#endif /* !CONFIG_USER_ONLY */
 hwaddr avr_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
 int avr_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg);
 int avr_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
diff --git a/target/avr/cpu.c b/target/avr/cpu.c
index ea14175ca55..e9fa54c9777 100644
--- a/target/avr/cpu.c
+++ b/target/avr/cpu.c
@@ -195,10 +195,10 @@ static const struct SysemuCPUOps avr_sysemu_ops = {
 static const struct TCGCPUOps avr_tcg_ops = {
     .initialize = avr_cpu_tcg_init,
     .synchronize_from_tb = avr_cpu_synchronize_from_tb,
-    .cpu_exec_interrupt = avr_cpu_exec_interrupt,
     .tlb_fill = avr_cpu_tlb_fill,
 
 #ifndef CONFIG_USER_ONLY
+    .cpu_exec_interrupt = avr_cpu_exec_interrupt,
     .do_interrupt = avr_cpu_do_interrupt,
 #endif /* !CONFIG_USER_ONLY */
 };
diff --git a/target/avr/helper.c b/target/avr/helper.c
index 981c29da453..84e366d94a3 100644
--- a/target/avr/helper.c
+++ b/target/avr/helper.c
@@ -25,6 +25,7 @@
 #include "exec/address-spaces.h"
 #include "exec/helper-proto.h"
 
+#ifndef CONFIG_USER_ONLY
 bool avr_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
 {
     bool ret = false;
@@ -91,6 +92,7 @@ void avr_cpu_do_interrupt(CPUState *cs)
 
     cs->exception_index = -1;
 }
+#endif /* !CONFIG_USER_ONLY */
 
 int avr_cpu_memory_rw_debug(CPUState *cs, vaddr addr, uint8_t *buf,
                             int len, bool is_write)
-- 
2.31.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]