Commit f94f35e5 authored by He Sheng's avatar He Sheng Committed by Zheng Zengkai
Browse files

sw64: fix setup_rt_frame for non SA_SIGINFO

Sunway inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I56YJ1



--------------------------------

Original implementation has deprecated sigframe and always use
rt_sigframe for signal handler. But glibc remain unchanged, where
handler takes $a2 as sigcontext pointer when SA_SIGINFO is not set
and compatibility is break. As on sw64, SA_SIGINFO is not only a
flag to specify sa_sigaction but also a flag to specify rt_sigframe
and rt_sigreturn. It used to setup old sigframe and specify sigreturn
for handler if SA_SIGINFO is not set.

To maintain compatibility, this patch set $a1 with exception code and
and set $a2 with sigcontext pointer in that case, which seems a mix
of modern rt_sigframe and traditional sigframe.

Actually, it is unnecessary to setup rt_sigframe for non SA_SIGINFO
handler, because a rt_sigframe is larger than sigframe. Maybe the old
sigframe will be reverted some day.

Signed-off-by: default avatarHe Sheng <hesheng@wxiat.com>

Signed-off-by: default avatarGu Zitao <guzitao@wxiat.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 29647217
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment