[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 6/7] target/ppc: moved ppc_cpu_do_interrupt to cpu.c
From: |
Bruno Larsen (billionai) |
Subject: |
[PATCH v2 6/7] target/ppc: moved ppc_cpu_do_interrupt to cpu.c |
Date: |
Tue, 18 May 2021 12:05:14 -0300 |
Moved the ppc_cpu_do_interrupt function to cpu.c file, where it makes
more sense, and turned powerpc_excp not static, as it now needs to be
accessed from outside of excp_helper.c
Signed-off-by: Bruno Larsen (billionai) <bruno.larsen@eldorado.org.br>
---
target/ppc/cpu.c | 20 ++++++++++++++++++++
target/ppc/cpu.h | 1 +
target/ppc/excp_helper.c | 19 +------------------
3 files changed, 22 insertions(+), 18 deletions(-)
diff --git a/target/ppc/cpu.c b/target/ppc/cpu.c
index a00ff2d5a3..eb4b705089 100644
--- a/target/ppc/cpu.c
+++ b/target/ppc/cpu.c
@@ -152,3 +152,23 @@ void ppc_store_fpscr(CPUPPCState *env, target_ulong val)
fpscr_set_rounding_mode(env);
}
}
+
+/* Exception processing */
+#if defined(CONFIG_USER_ONLY)
+void ppc_cpu_do_interrupt(CPUState *cs)
+{
+ PowerPCCPU *cpu = POWERPC_CPU(cs);
+ CPUPPCState *env = &cpu->env;
+
+ cs->exception_index = POWERPC_EXCP_NONE;
+ env->error_code = 0;
+}
+#else
+void ppc_cpu_do_interrupt(CPUState *cs)
+{
+ PowerPCCPU *cpu = POWERPC_CPU(cs);
+ CPUPPCState *env = &cpu->env;
+
+ powerpc_excp(cpu, env->excp_model, cs->exception_index);
+}
+#endif
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index b9eb2690cf..01dac2b12d 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -1258,6 +1258,7 @@ DECLARE_OBJ_CHECKERS(PPCVirtualHypervisor,
PPCVirtualHypervisorClass,
#endif /* CONFIG_USER_ONLY */
void ppc_cpu_do_interrupt(CPUState *cpu);
+void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp);
bool ppc_cpu_exec_interrupt(CPUState *cpu, int int_req);
void ppc_cpu_dump_state(CPUState *cpu, FILE *f, int flags);
void ppc_cpu_dump_statistics(CPUState *cpu, int flags);
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index f4f15279eb..80bb6e70e9 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -38,15 +38,6 @@
/*****************************************************************************/
/* Exception processing */
#if defined(CONFIG_USER_ONLY)
-void ppc_cpu_do_interrupt(CPUState *cs)
-{
- PowerPCCPU *cpu = POWERPC_CPU(cs);
- CPUPPCState *env = &cpu->env;
-
- cs->exception_index = POWERPC_EXCP_NONE;
- env->error_code = 0;
-}
-
static void ppc_hw_interrupt(CPUPPCState *env)
{
CPUState *cs = env_cpu(env);
@@ -324,7 +315,7 @@ static inline void powerpc_set_excp_state(PowerPCCPU *cpu,
* Note that this function should be greatly optimized when called
* with a constant excp, from ppc_hw_interrupt
*/
-static inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp)
+inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp)
{
CPUState *cs = CPU(cpu);
CPUPPCState *env = &cpu->env;
@@ -968,14 +959,6 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int
excp_model, int excp)
powerpc_set_excp_state(cpu, vector, new_msr);
}
-void ppc_cpu_do_interrupt(CPUState *cs)
-{
- PowerPCCPU *cpu = POWERPC_CPU(cs);
- CPUPPCState *env = &cpu->env;
-
- powerpc_excp(cpu, env->excp_model, cs->exception_index);
-}
-
static void ppc_hw_interrupt(CPUPPCState *env)
{
PowerPCCPU *cpu = env_archcpu(env);
--
2.17.1
- [PATCH v2 0/7] target/ppc: Misc motion to support disabling TCG, Bruno Larsen (billionai), 2021/05/18
- [PATCH v2 1/7] target/ppc: fix ppc_store_sdr1 for user-only compilation, Bruno Larsen (billionai), 2021/05/18
- [PATCH v2 2/7] target/ppc: moved ppc_store_lpcr and ppc_store_msr to cpu.c, Bruno Larsen (billionai), 2021/05/18
- [PATCH v2 3/7] target/ppc: reduce usage of fpscr_set_rounding_mode, Bruno Larsen (billionai), 2021/05/18
- [PATCH v2 4/7] target/ppc: overhauled and moved logic of storing fpscr, Bruno Larsen (billionai), 2021/05/18
- [PATCH v2 5/7] target/ppc: removed unnecessary inclusion of helper-proto.h, Bruno Larsen (billionai), 2021/05/18
- [PATCH v2 6/7] target/ppc: moved ppc_cpu_do_interrupt to cpu.c,
Bruno Larsen (billionai) <=
- [PATCH v2 7/7] target/ppc: wrapped some TCG only logic with ifdefs, Bruno Larsen (billionai), 2021/05/18