deleted file mode 100644
@@ -1,31 +0,0 @@
-/*
- * OpenRISC exception.
- *
- * Copyright (c) 2011-2012 Jia Liu <proljc@gmail.com>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "qemu/osdep.h"
-#include "accel/tcg/cpu-loop.h"
-#include "cpu.h"
-#include "exception.h"
-
-G_NORETURN void raise_exception(OpenRISCCPU *cpu, uint32_t excp)
-{
- CPUState *cs = CPU(cpu);
-
- cs->exception_index = excp;
- cpu_loop_exit(cs);
-}
@@ -21,7 +21,12 @@
#define TARGET_OPENRISC_EXCEPTION_H
#include "cpu.h"
+#include "accel/tcg/cpu-loop.h"
-G_NORETURN void raise_exception(OpenRISCCPU *cpu, uint32_t excp);
+static inline G_NORETURN
+void raise_exception(OpenRISCCPU *cpu, uint32_t excp)
+{
+ cpu_loop_exit_excp(CPU(cpu), excp, 0);
+}
#endif /* TARGET_OPENRISC_EXCEPTION_H */
@@ -21,22 +21,11 @@
#include "cpu.h"
#include "accel/tcg/cpu-loop.h"
#include "exec/helper-proto.h"
-#include "exception.h"
-
-void HELPER(exception)(CPUOpenRISCState *env, uint32_t excp)
-{
- OpenRISCCPU *cpu = env_archcpu(env);
-
- raise_exception(cpu, excp);
-}
static G_NORETURN
void do_range(CPUOpenRISCState *env, uintptr_t pc)
{
- CPUState *cs = env_cpu(env);
-
- cs->exception_index = EXCP_RANGE;
- cpu_loop_exit_restore(cs, pc);
+ cpu_loop_exit_excp(env_cpu(env), EXCP_RANGE, pc);
}
void HELPER(ove_cy)(CPUOpenRISCState *env)
@@ -18,7 +18,6 @@
*/
/* exception */
-DEF_HELPER_FLAGS_2(exception, TCG_CALL_NO_WG, void, env, i32)
DEF_HELPER_FLAGS_1(ove_cy, TCG_CALL_NO_WG, void, env)
DEF_HELPER_FLAGS_1(ove_ov, TCG_CALL_NO_WG, void, env)
DEF_HELPER_FLAGS_1(ove_cyov, TCG_CALL_NO_WG, void, env)
@@ -5,7 +5,6 @@ or1k_ss.add(gen)
or1k_ss.add(files(
'cpu.c',
'disas.c',
- 'exception.c',
'exception_helper.c',
'fpu_helper.c',
'interrupt_helper.c',
@@ -140,7 +140,7 @@ void openrisc_translate_init(void)
static void gen_exception(DisasContext *dc, unsigned int excp)
{
- gen_helper_exception(tcg_env, tcg_constant_i32(excp));
+ gen_helper_raise_excp(tcg_env, tcg_constant_i32(excp));
}
static void gen_illegal_exception(DisasContext *dc)
Translate through raise_excp. Drop the TCG exception helper and exception.c. Keep C raise_exception as a static inline in exception.h. Exit RANGE overflow through cpu_loop_exit_excp. Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> --- target/or1k/exception.c | 31 ------------------------------- target/or1k/exception.h | 7 ++++++- target/or1k/exception_helper.c | 13 +------------ target/or1k/helper.h | 1 - target/or1k/meson.build | 1 - target/or1k/translate.c | 2 +- 6 files changed, 8 insertions(+), 47 deletions(-) delete mode 100644 target/or1k/exception.c