mirror of
https://gitlab.com/qemu-project/qemu
synced 2024-09-06 18:05:37 +00:00
linux-user: define TARGET_ARCH_HAS_SETUP_FRAME
Instead of calling setup_frame() conditionally to a list of known targets, define TARGET_ARCH_HAS_SETUP_FRAME if the target provides the function and call it only if the macro is defined. Move declarations of setup_frame() and setup_rt_frame() to linux-user/signal-common.h Signed-off-by: Laurent Vivier <laurent@vivier.eu> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20180424192635.6027-21-laurent@vivier.eu>
This commit is contained in:
parent
9340eddae8
commit
cb6ac802ef
|
@ -26,9 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUARMState *state)
|
||||||
return state->xregs[31];
|
return state->xregs[31];
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_frame(int sig, struct target_sigaction *ka,
|
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||||
target_sigset_t *set, CPUARMState *env);
|
|
||||||
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info, target_sigset_t *set,
|
|
||||||
CPUARMState *env);
|
|
||||||
#endif /* AARCH64_TARGET_SIGNAL_H */
|
#endif /* AARCH64_TARGET_SIGNAL_H */
|
||||||
|
|
|
@ -55,9 +55,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUAlphaState *state)
|
||||||
#define TARGET_GEN_SUBRNG6 -24
|
#define TARGET_GEN_SUBRNG6 -24
|
||||||
#define TARGET_GEN_SUBRNG7 -25
|
#define TARGET_GEN_SUBRNG7 -25
|
||||||
|
|
||||||
void setup_frame(int sig, struct target_sigaction *ka,
|
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||||
target_sigset_t *set, CPUAlphaState *env);
|
|
||||||
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info,
|
|
||||||
target_sigset_t *set, CPUAlphaState *env);
|
|
||||||
#endif /* ALPHA_TARGET_SIGNAL_H */
|
#endif /* ALPHA_TARGET_SIGNAL_H */
|
||||||
|
|
|
@ -26,9 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUARMState *state)
|
||||||
return state->regs[13];
|
return state->regs[13];
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_frame(int usig, struct target_sigaction *ka,
|
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||||
target_sigset_t *set, CPUARMState *regs);
|
|
||||||
void setup_rt_frame(int usig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info,
|
|
||||||
target_sigset_t *set, CPUARMState *env);
|
|
||||||
#endif /* ARM_TARGET_SIGNAL_H */
|
#endif /* ARM_TARGET_SIGNAL_H */
|
||||||
|
|
|
@ -26,9 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUCRISState *state)
|
||||||
return state->regs[14];
|
return state->regs[14];
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_frame(int sig, struct target_sigaction *ka,
|
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||||
target_sigset_t *set, CPUCRISState *env);
|
|
||||||
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info,
|
|
||||||
target_sigset_t *set, CPUCRISState *env);
|
|
||||||
#endif /* CRIS_TARGET_SIGNAL_H */
|
#endif /* CRIS_TARGET_SIGNAL_H */
|
||||||
|
|
|
@ -25,8 +25,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUHPPAState *state)
|
||||||
{
|
{
|
||||||
return state->gr[30];
|
return state->gr[30];
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info,
|
|
||||||
target_sigset_t *set, CPUArchState *env);
|
|
||||||
#endif /* HPPA_TARGET_SIGNAL_H */
|
#endif /* HPPA_TARGET_SIGNAL_H */
|
||||||
|
|
|
@ -26,9 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUX86State *state)
|
||||||
return state->regs[R_ESP];
|
return state->regs[R_ESP];
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_frame(int sig, struct target_sigaction *ka,
|
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||||
target_sigset_t *set, CPUX86State *env);
|
|
||||||
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info,
|
|
||||||
target_sigset_t *set, CPUX86State *env);
|
|
||||||
#endif /* I386_TARGET_SIGNAL_H */
|
#endif /* I386_TARGET_SIGNAL_H */
|
||||||
|
|
|
@ -26,9 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUM68KState *state)
|
||||||
return state->aregs[7];
|
return state->aregs[7];
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_frame(int sig, struct target_sigaction *ka,
|
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||||
target_sigset_t *set, CPUM68KState *env);
|
|
||||||
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info,
|
|
||||||
target_sigset_t *set, CPUM68KState *env);
|
|
||||||
#endif /* M68K_TARGET_SIGNAL_H */
|
#endif /* M68K_TARGET_SIGNAL_H */
|
||||||
|
|
|
@ -26,9 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUMBState *state)
|
||||||
return state->regs[1];
|
return state->regs[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_frame(int sig, struct target_sigaction *ka,
|
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||||
target_sigset_t *set, CPUMBState *env);
|
|
||||||
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info,
|
|
||||||
target_sigset_t *set, CPUMBState *env);
|
|
||||||
#endif /* MICROBLAZE_TARGET_SIGNAL_H */
|
#endif /* MICROBLAZE_TARGET_SIGNAL_H */
|
||||||
|
|
|
@ -26,12 +26,8 @@ static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state)
|
||||||
return state->active_tc.gpr[29];
|
return state->active_tc.gpr[29];
|
||||||
}
|
}
|
||||||
|
|
||||||
# if defined(TARGET_ABI_MIPSO32)
|
#if defined(TARGET_ABI_MIPSO32)
|
||||||
/* compare linux/arch/mips/kernel/signal.c:setup_frame() */
|
/* compare linux/arch/mips/kernel/signal.c:setup_frame() */
|
||||||
void setup_frame(int sig, struct target_sigaction * ka,
|
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||||
target_sigset_t *set, CPUMIPSState *regs);
|
|
||||||
#endif
|
#endif
|
||||||
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info,
|
|
||||||
target_sigset_t *set, CPUMIPSState *env);
|
|
||||||
#endif /* MIPS_TARGET_SIGNAL_H */
|
#endif /* MIPS_TARGET_SIGNAL_H */
|
||||||
|
|
|
@ -25,8 +25,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state)
|
||||||
{
|
{
|
||||||
return state->active_tc.gpr[29];
|
return state->active_tc.gpr[29];
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info,
|
|
||||||
target_sigset_t *set, CPUMIPSState *env);
|
|
||||||
#endif /* MIPS64_TARGET_SIGNAL_H */
|
#endif /* MIPS64_TARGET_SIGNAL_H */
|
||||||
|
|
|
@ -22,9 +22,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUNios2State *state)
|
||||||
{
|
{
|
||||||
return state->regs[R_SP];
|
return state->regs[R_SP];
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info,
|
|
||||||
target_sigset_t *set,
|
|
||||||
CPUNios2State *env);
|
|
||||||
#endif /* TARGET_SIGNAL_H */
|
#endif /* TARGET_SIGNAL_H */
|
||||||
|
|
|
@ -22,8 +22,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUOpenRISCState *state)
|
||||||
{
|
{
|
||||||
return cpu_get_gpr(state, 1);
|
return cpu_get_gpr(state, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info,
|
|
||||||
target_sigset_t *set, CPUOpenRISCState *env);
|
|
||||||
#endif /* OPENRISC_TARGET_SIGNAL_H */
|
#endif /* OPENRISC_TARGET_SIGNAL_H */
|
||||||
|
|
|
@ -27,10 +27,6 @@ static inline abi_ulong get_sp_from_cpustate(CPUPPCState *state)
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(TARGET_PPC64)
|
#if !defined(TARGET_PPC64)
|
||||||
void setup_frame(int sig, struct target_sigaction *ka,
|
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||||
target_sigset_t *set, CPUPPCState *env);
|
|
||||||
#endif
|
#endif
|
||||||
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info,
|
|
||||||
target_sigset_t *set, CPUPPCState *env);
|
|
||||||
#endif /* PPC_TARGET_SIGNAL_H */
|
#endif /* PPC_TARGET_SIGNAL_H */
|
||||||
|
|
|
@ -19,8 +19,4 @@ static inline abi_ulong get_sp_from_cpustate(CPURISCVState *state)
|
||||||
{
|
{
|
||||||
return state->gpr[xSP];
|
return state->gpr[xSP];
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info,
|
|
||||||
target_sigset_t *set, CPURISCVState *env);
|
|
||||||
#endif /* TARGET_SIGNAL_H */
|
#endif /* TARGET_SIGNAL_H */
|
||||||
|
|
|
@ -23,9 +23,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUS390XState *state)
|
||||||
return state->regs[15];
|
return state->regs[15];
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_frame(int sig, struct target_sigaction *ka,
|
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||||
target_sigset_t *set, CPUS390XState *env);
|
|
||||||
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info,
|
|
||||||
target_sigset_t *set, CPUS390XState *env);
|
|
||||||
#endif /* S390X_TARGET_SIGNAL_H */
|
#endif /* S390X_TARGET_SIGNAL_H */
|
||||||
|
|
|
@ -26,10 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUSH4State *state)
|
||||||
return state->gregs[15];
|
return state->gregs[15];
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_frame(int sig, struct target_sigaction *ka,
|
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||||
target_sigset_t *set, CPUSH4State *regs);
|
|
||||||
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info,
|
|
||||||
target_sigset_t *set, CPUSH4State *regs);
|
|
||||||
|
|
||||||
#endif /* SH4_TARGET_SIGNAL_H */
|
#endif /* SH4_TARGET_SIGNAL_H */
|
||||||
|
|
|
@ -47,4 +47,11 @@ void tswap_siginfo(target_siginfo_t *tinfo,
|
||||||
void set_sigmask(const sigset_t *set);
|
void set_sigmask(const sigset_t *set);
|
||||||
void force_sig(int sig);
|
void force_sig(int sig);
|
||||||
void force_sigsegv(int oldsig);
|
void force_sigsegv(int oldsig);
|
||||||
|
#if defined(TARGET_ARCH_HAS_SETUP_FRAME)
|
||||||
|
void setup_frame(int sig, struct target_sigaction *ka,
|
||||||
|
target_sigset_t *set, CPUArchState *env);
|
||||||
|
#endif
|
||||||
|
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
||||||
|
target_siginfo_t *info,
|
||||||
|
target_sigset_t *set, CPUArchState *env);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -873,18 +873,15 @@ static void handle_pending_signal(CPUArchState *cpu_env, int sig,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* prepare the stack frame of the virtual CPU */
|
/* prepare the stack frame of the virtual CPU */
|
||||||
#if defined(TARGET_ABI_MIPSN32) || defined(TARGET_ABI_MIPSN64) \
|
#if defined(TARGET_ARCH_HAS_SETUP_FRAME)
|
||||||
|| defined(TARGET_OPENRISC) || defined(TARGET_TILEGX) \
|
if (sa->sa_flags & TARGET_SA_SIGINFO) {
|
||||||
|| defined(TARGET_PPC64) || defined(TARGET_HPPA) \
|
setup_rt_frame(sig, sa, &k->info, &target_old_set, cpu_env);
|
||||||
|| defined(TARGET_NIOS2) || defined(TARGET_X86_64) \
|
} else {
|
||||||
|| defined(TARGET_RISCV) || defined(TARGET_XTENSA)
|
setup_frame(sig, sa, &target_old_set, cpu_env);
|
||||||
|
}
|
||||||
|
#else
|
||||||
/* These targets do not have traditional signals. */
|
/* These targets do not have traditional signals. */
|
||||||
setup_rt_frame(sig, sa, &k->info, &target_old_set, cpu_env);
|
setup_rt_frame(sig, sa, &k->info, &target_old_set, cpu_env);
|
||||||
#else
|
|
||||||
if (sa->sa_flags & TARGET_SA_SIGINFO)
|
|
||||||
setup_rt_frame(sig, sa, &k->info, &target_old_set, cpu_env);
|
|
||||||
else
|
|
||||||
setup_frame(sig, sa, &target_old_set, cpu_env);
|
|
||||||
#endif
|
#endif
|
||||||
if (sa->sa_flags & TARGET_SA_RESETHAND) {
|
if (sa->sa_flags & TARGET_SA_RESETHAND) {
|
||||||
sa->_sa_handler = TARGET_SIG_DFL;
|
sa->_sa_handler = TARGET_SIG_DFL;
|
||||||
|
|
|
@ -33,9 +33,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUSPARCState *state)
|
||||||
return state->regwptr[UREG_FP];
|
return state->regwptr[UREG_FP];
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_frame(int sig, struct target_sigaction *ka,
|
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||||
target_sigset_t *set, CPUSPARCState *env);
|
|
||||||
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info,
|
|
||||||
target_sigset_t *set, CPUSPARCState *env);
|
|
||||||
#endif /* SPARC_TARGET_SIGNAL_H */
|
#endif /* SPARC_TARGET_SIGNAL_H */
|
||||||
|
|
|
@ -33,9 +33,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUSPARCState *state)
|
||||||
return state->regwptr[UREG_FP];
|
return state->regwptr[UREG_FP];
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_frame(int sig, struct target_sigaction *ka,
|
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||||
target_sigset_t *set, CPUSPARCState *env);
|
|
||||||
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info,
|
|
||||||
target_sigset_t *set, CPUSPARCState *env);
|
|
||||||
#endif /* SPARC64_TARGET_SIGNAL_H */
|
#endif /* SPARC64_TARGET_SIGNAL_H */
|
||||||
|
|
|
@ -24,8 +24,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUTLGState *state)
|
||||||
{
|
{
|
||||||
return state->regs[TILEGX_R_SP];
|
return state->regs[TILEGX_R_SP];
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info,
|
|
||||||
target_sigset_t *set, CPUArchState *env);
|
|
||||||
#endif /* TILEGX_TARGET_SIGNAL_H */
|
#endif /* TILEGX_TARGET_SIGNAL_H */
|
||||||
|
|
|
@ -25,8 +25,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUX86State *state)
|
||||||
{
|
{
|
||||||
return state->regs[R_ESP];
|
return state->regs[R_ESP];
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info,
|
|
||||||
target_sigset_t *set, CPUX86State *env);
|
|
||||||
#endif /* X86_64_TARGET_SIGNAL_H */
|
#endif /* X86_64_TARGET_SIGNAL_H */
|
||||||
|
|
|
@ -24,8 +24,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUXtensaState *state)
|
||||||
{
|
{
|
||||||
return state->regs[1];
|
return state->regs[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
void setup_rt_frame(int sig, struct target_sigaction *ka,
|
|
||||||
target_siginfo_t *info,
|
|
||||||
target_sigset_t *set, CPUXtensaState *env);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue