mirror of https://github.com/xemu-project/xemu.git
target/nios2: Remove nios2_cpu_record_sigsegv
Since f5ef0e518d
, we have a real page mapped for kuser,
which means the special casing for SIGSEGV can go away.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20220421151735.31996-11-richard.henderson@linaro.org>
This commit is contained in:
parent
3c818909b0
commit
fb4de9d235
|
@ -126,16 +126,6 @@ void cpu_loop(CPUNios2State *env)
|
||||||
info.si_code = TARGET_TRAP_BRKPT;
|
info.si_code = TARGET_TRAP_BRKPT;
|
||||||
queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
|
queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
|
||||||
break;
|
break;
|
||||||
case 0xaa:
|
|
||||||
{
|
|
||||||
info.si_signo = TARGET_SIGSEGV;
|
|
||||||
info.si_errno = 0;
|
|
||||||
/* TODO: check env->error_code */
|
|
||||||
info.si_code = TARGET_SEGV_MAPERR;
|
|
||||||
info._sifields._sigfault._addr = env->regs[R_PC];
|
|
||||||
queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
EXCP_DUMP(env, "\nqemu: unhandled CPU exception %#x - aborting\n",
|
EXCP_DUMP(env, "\nqemu: unhandled CPU exception %#x - aborting\n",
|
||||||
trapnr);
|
trapnr);
|
||||||
|
|
|
@ -210,9 +210,7 @@ static const struct SysemuCPUOps nios2_sysemu_ops = {
|
||||||
static const struct TCGCPUOps nios2_tcg_ops = {
|
static const struct TCGCPUOps nios2_tcg_ops = {
|
||||||
.initialize = nios2_tcg_init,
|
.initialize = nios2_tcg_init,
|
||||||
|
|
||||||
#ifdef CONFIG_USER_ONLY
|
#ifndef CONFIG_USER_ONLY
|
||||||
.record_sigsegv = nios2_cpu_record_sigsegv,
|
|
||||||
#else
|
|
||||||
.tlb_fill = nios2_cpu_tlb_fill,
|
.tlb_fill = nios2_cpu_tlb_fill,
|
||||||
.cpu_exec_interrupt = nios2_cpu_exec_interrupt,
|
.cpu_exec_interrupt = nios2_cpu_exec_interrupt,
|
||||||
.do_interrupt = nios2_cpu_do_interrupt,
|
.do_interrupt = nios2_cpu_do_interrupt,
|
||||||
|
|
|
@ -216,11 +216,7 @@ static inline int cpu_mmu_index(CPUNios2State *env, bool ifetch)
|
||||||
MMU_SUPERVISOR_IDX;
|
MMU_SUPERVISOR_IDX;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_USER_ONLY
|
#ifndef CONFIG_USER_ONLY
|
||||||
void nios2_cpu_record_sigsegv(CPUState *cpu, vaddr addr,
|
|
||||||
MMUAccessType access_type,
|
|
||||||
bool maperr, uintptr_t ra);
|
|
||||||
#else
|
|
||||||
bool nios2_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
|
bool nios2_cpu_tlb_fill(CPUState *cs, vaddr address, int size,
|
||||||
MMUAccessType access_type, int mmu_idx,
|
MMUAccessType access_type, int mmu_idx,
|
||||||
bool probe, uintptr_t retaddr);
|
bool probe, uintptr_t retaddr);
|
||||||
|
|
|
@ -28,19 +28,7 @@
|
||||||
#include "exec/helper-proto.h"
|
#include "exec/helper-proto.h"
|
||||||
#include "semihosting/semihost.h"
|
#include "semihosting/semihost.h"
|
||||||
|
|
||||||
#if defined(CONFIG_USER_ONLY)
|
#if !defined(CONFIG_USER_ONLY)
|
||||||
|
|
||||||
void nios2_cpu_record_sigsegv(CPUState *cs, vaddr addr,
|
|
||||||
MMUAccessType access_type,
|
|
||||||
bool maperr, uintptr_t retaddr)
|
|
||||||
{
|
|
||||||
/* FIXME: Disentangle kuser page from linux-user sigsegv handling. */
|
|
||||||
cs->exception_index = 0xaa;
|
|
||||||
cpu_loop_exit_restore(cs, retaddr);
|
|
||||||
}
|
|
||||||
|
|
||||||
#else /* !CONFIG_USER_ONLY */
|
|
||||||
|
|
||||||
void nios2_cpu_do_interrupt(CPUState *cs)
|
void nios2_cpu_do_interrupt(CPUState *cs)
|
||||||
{
|
{
|
||||||
Nios2CPU *cpu = NIOS2_CPU(cs);
|
Nios2CPU *cpu = NIOS2_CPU(cs);
|
||||||
|
|
Loading…
Reference in New Issue