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:
Laurent Vivier 2018-04-24 21:26:35 +02:00
parent 9340eddae8
commit cb6ac802ef
23 changed files with 28 additions and 110 deletions

View file

@ -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;