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];
|
||||
}
|
||||
|
||||
void setup_frame(int sig, struct target_sigaction *ka,
|
||||
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);
|
||||
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||
#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_SUBRNG7 -25
|
||||
|
||||
void setup_frame(int sig, struct target_sigaction *ka,
|
||||
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);
|
||||
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||
#endif /* ALPHA_TARGET_SIGNAL_H */
|
||||
|
@ -26,9 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUARMState *state)
|
||||
return state->regs[13];
|
||||
}
|
||||
|
||||
void setup_frame(int usig, struct target_sigaction *ka,
|
||||
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);
|
||||
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||
#endif /* ARM_TARGET_SIGNAL_H */
|
||||
|
@ -26,9 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUCRISState *state)
|
||||
return state->regs[14];
|
||||
}
|
||||
|
||||
void setup_frame(int sig, struct target_sigaction *ka,
|
||||
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);
|
||||
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||
#endif /* CRIS_TARGET_SIGNAL_H */
|
||||
|
@ -25,8 +25,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUHPPAState *state)
|
||||
{
|
||||
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 */
|
||||
|
@ -26,9 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUX86State *state)
|
||||
return state->regs[R_ESP];
|
||||
}
|
||||
|
||||
void setup_frame(int sig, struct target_sigaction *ka,
|
||||
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);
|
||||
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||
#endif /* I386_TARGET_SIGNAL_H */
|
||||
|
@ -26,9 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUM68KState *state)
|
||||
return state->aregs[7];
|
||||
}
|
||||
|
||||
void setup_frame(int sig, struct target_sigaction *ka,
|
||||
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);
|
||||
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||
#endif /* M68K_TARGET_SIGNAL_H */
|
||||
|
@ -26,9 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUMBState *state)
|
||||
return state->regs[1];
|
||||
}
|
||||
|
||||
void setup_frame(int sig, struct target_sigaction *ka,
|
||||
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);
|
||||
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||
#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];
|
||||
}
|
||||
|
||||
# if defined(TARGET_ABI_MIPSO32)
|
||||
#if defined(TARGET_ABI_MIPSO32)
|
||||
/* compare linux/arch/mips/kernel/signal.c:setup_frame() */
|
||||
void setup_frame(int sig, struct target_sigaction * ka,
|
||||
target_sigset_t *set, CPUMIPSState *regs);
|
||||
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||
#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 */
|
||||
|
@ -25,8 +25,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUMIPSState *state)
|
||||
{
|
||||
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 */
|
||||
|
@ -22,9 +22,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUNios2State *state)
|
||||
{
|
||||
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 */
|
||||
|
@ -22,8 +22,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUOpenRISCState *state)
|
||||
{
|
||||
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 */
|
||||
|
@ -27,10 +27,6 @@ static inline abi_ulong get_sp_from_cpustate(CPUPPCState *state)
|
||||
}
|
||||
|
||||
#if !defined(TARGET_PPC64)
|
||||
void setup_frame(int sig, struct target_sigaction *ka,
|
||||
target_sigset_t *set, CPUPPCState *env);
|
||||
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||
#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 */
|
||||
|
@ -19,8 +19,4 @@ static inline abi_ulong get_sp_from_cpustate(CPURISCVState *state)
|
||||
{
|
||||
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 */
|
||||
|
@ -23,9 +23,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUS390XState *state)
|
||||
return state->regs[15];
|
||||
}
|
||||
|
||||
void setup_frame(int sig, struct target_sigaction *ka,
|
||||
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);
|
||||
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||
#endif /* S390X_TARGET_SIGNAL_H */
|
||||
|
@ -26,10 +26,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUSH4State *state)
|
||||
return state->gregs[15];
|
||||
}
|
||||
|
||||
void setup_frame(int sig, struct target_sigaction *ka,
|
||||
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);
|
||||
|
||||
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||
#endif /* SH4_TARGET_SIGNAL_H */
|
||||
|
@ -47,4 +47,11 @@ void tswap_siginfo(target_siginfo_t *tinfo,
|
||||
void set_sigmask(const sigset_t *set);
|
||||
void force_sig(int sig);
|
||||
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
|
||||
|
@ -873,18 +873,15 @@ static void handle_pending_signal(CPUArchState *cpu_env, int sig,
|
||||
}
|
||||
#endif
|
||||
/* prepare the stack frame of the virtual CPU */
|
||||
#if defined(TARGET_ABI_MIPSN32) || defined(TARGET_ABI_MIPSN64) \
|
||||
|| defined(TARGET_OPENRISC) || defined(TARGET_TILEGX) \
|
||||
|| defined(TARGET_PPC64) || defined(TARGET_HPPA) \
|
||||
|| defined(TARGET_NIOS2) || defined(TARGET_X86_64) \
|
||||
|| defined(TARGET_RISCV) || defined(TARGET_XTENSA)
|
||||
#if defined(TARGET_ARCH_HAS_SETUP_FRAME)
|
||||
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);
|
||||
}
|
||||
#else
|
||||
/* These targets do not have traditional signals. */
|
||||
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
|
||||
if (sa->sa_flags & TARGET_SA_RESETHAND) {
|
||||
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];
|
||||
}
|
||||
|
||||
void setup_frame(int sig, struct target_sigaction *ka,
|
||||
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);
|
||||
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||
#endif /* SPARC_TARGET_SIGNAL_H */
|
||||
|
@ -33,9 +33,5 @@ static inline abi_ulong get_sp_from_cpustate(CPUSPARCState *state)
|
||||
return state->regwptr[UREG_FP];
|
||||
}
|
||||
|
||||
void setup_frame(int sig, struct target_sigaction *ka,
|
||||
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);
|
||||
#define TARGET_ARCH_HAS_SETUP_FRAME
|
||||
#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];
|
||||
}
|
||||
|
||||
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 */
|
||||
|
@ -25,8 +25,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUX86State *state)
|
||||
{
|
||||
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 */
|
||||
|
@ -24,8 +24,4 @@ static inline abi_ulong get_sp_from_cpustate(CPUXtensaState *state)
|
||||
{
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user