e2k: Remove syscall helper.
Signed-off-by: Denis Drakhnya <numas13@gmail.com>
This commit is contained in:
parent
c8ed74f626
commit
21ff5cbef9
|
@ -203,13 +203,6 @@ static inline void do_call(CPUE2KState *env, int wbs, target_ulong ret_ip)
|
||||||
reset_ctprs(env);
|
reset_ctprs(env);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HELPER(syscall)(CPUE2KState *env)
|
|
||||||
{
|
|
||||||
CPUState *cs = env_cpu(env);
|
|
||||||
cs->exception_index = EXCP_SYSCALL;
|
|
||||||
cpu_loop_exit(cs);
|
|
||||||
}
|
|
||||||
|
|
||||||
void HELPER(call)(CPUE2KState *env, uint64_t ctpr_raw, int call_wbs,
|
void HELPER(call)(CPUE2KState *env, uint64_t ctpr_raw, int call_wbs,
|
||||||
target_ulong pc_next)
|
target_ulong pc_next)
|
||||||
{
|
{
|
||||||
|
@ -249,7 +242,12 @@ uint64_t HELPER(prep_return)(CPUE2KState *env, int ipd)
|
||||||
ret.ipd = ipd;
|
ret.ipd = ipd;
|
||||||
ret.base = cr0_hi;
|
ret.base = cr0_hi;
|
||||||
ret.tag = CTPR_TAG_RETURN;
|
ret.tag = CTPR_TAG_RETURN;
|
||||||
|
#ifdef CONFIG_USER_ONLY
|
||||||
ret.opc = cr0_hi == E2K_SIGRET_ADDR ? CTPR_OPC_SIGRET : 0;
|
ret.opc = cr0_hi == E2K_SIGRET_ADDR ? CTPR_OPC_SIGRET : 0;
|
||||||
|
#else
|
||||||
|
// TODO: set ctpr.opc
|
||||||
|
ret.opc = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
return ret.raw;
|
return ret.raw;
|
||||||
}
|
}
|
||||||
|
@ -258,6 +256,7 @@ void HELPER(return)(CPUE2KState *env)
|
||||||
{
|
{
|
||||||
CtprOpc opc = env->ctprs[2].opc;
|
CtprOpc opc = env->ctprs[2].opc;
|
||||||
|
|
||||||
|
#ifdef CONFIG_USER_ONLY
|
||||||
if (opc == CTPR_OPC_SIGRET) {
|
if (opc == CTPR_OPC_SIGRET) {
|
||||||
CPUState *cs = env_cpu(env);
|
CPUState *cs = env_cpu(env);
|
||||||
env->wd.psize = 2;
|
env->wd.psize = 2;
|
||||||
|
@ -265,7 +264,9 @@ void HELPER(return)(CPUE2KState *env)
|
||||||
env->tags[0] = E2K_TAG_NUMBER64;
|
env->tags[0] = E2K_TAG_NUMBER64;
|
||||||
cs->exception_index = EXCP_SYSCALL;
|
cs->exception_index = EXCP_SYSCALL;
|
||||||
cpu_loop_exit(cs);
|
cpu_loop_exit(cs);
|
||||||
} else {
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (opc != 0) {
|
if (opc != 0) {
|
||||||
qemu_log(TARGET_FMT_lx ": unknown return ctpr opc %d\n", env->ip, opc);
|
qemu_log(TARGET_FMT_lx ": unknown return ctpr opc %d\n", env->ip, opc);
|
||||||
}
|
}
|
||||||
|
@ -273,7 +274,6 @@ void HELPER(return)(CPUE2KState *env)
|
||||||
e2k_proc_return(env, false);
|
e2k_proc_return(env, false);
|
||||||
reset_ctprs(env);
|
reset_ctprs(env);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void G_NORETURN raise_exception(CPUE2KState *env, int exception_index)
|
void G_NORETURN raise_exception(CPUE2KState *env, int exception_index)
|
||||||
{
|
{
|
||||||
|
@ -285,6 +285,9 @@ void G_NORETURN raise_exception_ra(CPUE2KState *env, int exception_index,
|
||||||
{
|
{
|
||||||
CPUState *cs = env_cpu(env);
|
CPUState *cs = env_cpu(env);
|
||||||
switch (exception_index) {
|
switch (exception_index) {
|
||||||
|
#ifdef CONFIG_USER_ONLY
|
||||||
|
case EXCP_SYSCALL:
|
||||||
|
#endif
|
||||||
case EXCP_PROC_STACK_BOUNDS:
|
case EXCP_PROC_STACK_BOUNDS:
|
||||||
case EXCP_CHAIN_STACK_BOUNDS:
|
case EXCP_CHAIN_STACK_BOUNDS:
|
||||||
/* ignore */
|
/* ignore */
|
||||||
|
|
|
@ -8,9 +8,10 @@
|
||||||
#define dh_is_signed_f80 dh_is_signed_ptr
|
#define dh_is_signed_f80 dh_is_signed_ptr
|
||||||
|
|
||||||
DEF_HELPER_2(raise_exception, noreturn, env, int)
|
DEF_HELPER_2(raise_exception, noreturn, env, int)
|
||||||
DEF_HELPER_1(syscall, noreturn, env)
|
|
||||||
DEF_HELPER_1(break_restore_state, void, env)
|
DEF_HELPER_1(break_restore_state, void, env)
|
||||||
|
#ifdef CONFIG_USER_ONLY
|
||||||
DEF_HELPER_1(expand_stacks, void, env)
|
DEF_HELPER_1(expand_stacks, void, env)
|
||||||
|
#endif
|
||||||
|
|
||||||
DEF_HELPER_4(call, void, env, i64, int, tl)
|
DEF_HELPER_4(call, void, env, i64, int, tl)
|
||||||
DEF_HELPER_2(prep_return, i64, env, int)
|
DEF_HELPER_2(prep_return, i64, env, int)
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#include "qemu/osdep.h"
|
#include "qemu/osdep.h"
|
||||||
#include "qemu.h"
|
|
||||||
#include "exec/log.h"
|
#include "exec/log.h"
|
||||||
#include "exec/translator.h"
|
#include "exec/translator.h"
|
||||||
#include "tcg/tcg-op.h"
|
#include "tcg/tcg-op.h"
|
||||||
|
@ -7367,11 +7366,15 @@ static inline void gen_cs0(DisasContext *ctx)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CS0_SDISP: {
|
case CS0_SDISP: {
|
||||||
|
#ifdef CONFIG_USER_ONLY
|
||||||
// TODO: real sdisp target address
|
// TODO: real sdisp target address
|
||||||
target_ulong target = E2K_FAKE_KERN_START;
|
target_ulong target = E2K_FAKE_KERN_START;
|
||||||
target = deposit64(target, 11, 17, cs0->sdisp.disp);
|
target = deposit64(target, 11, 17, cs0->sdisp.disp);
|
||||||
uint64_t ctpr = ctpr_new(CTPR_TAG_SDISP, 0, cs0->sdisp.ipd, target);
|
uint64_t ctpr = ctpr_new(CTPR_TAG_SDISP, 0, cs0->sdisp.ipd, target);
|
||||||
gen_set_ctpr(cs0->sdisp.ctpr, ctpr);
|
gen_set_ctpr(cs0->sdisp.ctpr, ctpr);
|
||||||
|
#else
|
||||||
|
e2k_todo(ctx, "sdisp");
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CS0_RETURN: {
|
case CS0_RETURN: {
|
||||||
|
@ -7930,7 +7933,7 @@ static void e2k_tr_translate_insn(DisasContextBase *db, CPUState *cs)
|
||||||
ctx->base.is_jmp = DISAS_NORETURN;
|
ctx->base.is_jmp = DISAS_NORETURN;
|
||||||
/* force non-zero tb size */
|
/* force non-zero tb size */
|
||||||
pc_next = ctx->base.pc_next + 8;
|
pc_next = ctx->base.pc_next + 8;
|
||||||
gen_helper_syscall(cpu_env);
|
gen_tr_exception(ctx, EXCP_SYSCALL);
|
||||||
tcg_gen_exit_tb(NULL, TB_EXIT_IDX0);
|
tcg_gen_exit_tb(NULL, TB_EXIT_IDX0);
|
||||||
break;
|
break;
|
||||||
case E2K_SYSRET_BACKTRACE_ADDR:
|
case E2K_SYSRET_BACKTRACE_ADDR:
|
||||||
|
|
Loading…
Reference in New Issue