Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gsplhtlxg
clone-Linux
提交
99b06feb
C
clone-Linux
项目概览
gsplhtlxg
/
clone-Linux
通知
2
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
clone-Linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
99b06feb
编写于
12月 23, 2012
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sparc: switch to generic sigaltstack
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
0aa0203f
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
11 addition
and
84 deletion
+11
-84
arch/sparc/Kconfig
arch/sparc/Kconfig
+1
-0
arch/sparc/include/asm/compat_signal.h
arch/sparc/include/asm/compat_signal.h
+0
-6
arch/sparc/kernel/entry.S
arch/sparc/kernel/entry.S
+0
-8
arch/sparc/kernel/signal32.c
arch/sparc/kernel/signal32.c
+4
-44
arch/sparc/kernel/signal_32.c
arch/sparc/kernel/signal_32.c
+2
-15
arch/sparc/kernel/signal_64.c
arch/sparc/kernel/signal_64.c
+3
-4
arch/sparc/kernel/syscalls.S
arch/sparc/kernel/syscalls.S
+0
-6
arch/sparc/kernel/systbls_64.S
arch/sparc/kernel/systbls_64.S
+1
-1
未找到文件。
arch/sparc/Kconfig
浏览文件 @
99b06feb
...
@@ -42,6 +42,7 @@ config SPARC
...
@@ -42,6 +42,7 @@ config SPARC
select GENERIC_STRNLEN_USER
select GENERIC_STRNLEN_USER
select MODULES_USE_ELF_RELA
select MODULES_USE_ELF_RELA
select ODD_RT_SIGACTION
select ODD_RT_SIGACTION
select GENERIC_SIGALTSTACK
config SPARC32
config SPARC32
def_bool !64BIT
def_bool !64BIT
...
...
arch/sparc/include/asm/compat_signal.h
浏览文件 @
99b06feb
...
@@ -18,12 +18,6 @@ struct __old_sigaction32 {
...
@@ -18,12 +18,6 @@ struct __old_sigaction32 {
unsigned
int
sa_flags
;
unsigned
int
sa_flags
;
unsigned
sa_restorer
;
/* not used by Linux/SPARC yet */
unsigned
sa_restorer
;
/* not used by Linux/SPARC yet */
};
};
typedef
struct
sigaltstack32
{
u32
ss_sp
;
int
ss_flags
;
compat_size_t
ss_size
;
}
stack_t32
;
#endif
#endif
#endif
/* !(_COMPAT_SIGNAL_H) */
#endif
/* !(_COMPAT_SIGNAL_H) */
arch/sparc/kernel/entry.S
浏览文件 @
99b06feb
...
@@ -819,14 +819,6 @@ sys_sparc_pipe:
...
@@ -819,14 +819,6 @@ sys_sparc_pipe:
call
sparc_pipe
call
sparc_pipe
mov
%
l5
,
%
o7
mov
%
l5
,
%
o7
.
align
4
.
globl
sys_sigaltstack
sys_sigaltstack
:
mov
%
o7
,
%
l5
mov
%
fp
,
%
o2
call
do_sigaltstack
mov
%
l5
,
%
o7
.
align
4
.
align
4
.
globl
sys_sigstack
.
globl
sys_sigstack
sys_sigstack
:
sys_sigstack
:
...
...
arch/sparc/kernel/signal32.c
浏览文件 @
99b06feb
...
@@ -61,7 +61,7 @@ struct rt_signal_frame32 {
...
@@ -61,7 +61,7 @@ struct rt_signal_frame32 {
compat_sigset_t
mask
;
compat_sigset_t
mask
;
/* __siginfo_fpu_t * */
u32
fpu_save
;
/* __siginfo_fpu_t * */
u32
fpu_save
;
unsigned
int
insns
[
2
];
unsigned
int
insns
[
2
];
stack_t32
stack
;
compat_stack_t
stack
;
unsigned
int
extra_size
;
/* Should be sizeof(siginfo_extra_v8plus_t) */
unsigned
int
extra_size
;
/* Should be sizeof(siginfo_extra_v8plus_t) */
/* Only valid if (regs.psr & (PSR_VERS|PSR_IMPL)) == PSR_V8PLUS */
/* Only valid if (regs.psr & (PSR_VERS|PSR_IMPL)) == PSR_V8PLUS */
siginfo_extra_v8plus_t
v8plus
;
siginfo_extra_v8plus_t
v8plus
;
...
@@ -230,13 +230,11 @@ void do_sigreturn32(struct pt_regs *regs)
...
@@ -230,13 +230,11 @@ void do_sigreturn32(struct pt_regs *regs)
asmlinkage
void
do_rt_sigreturn32
(
struct
pt_regs
*
regs
)
asmlinkage
void
do_rt_sigreturn32
(
struct
pt_regs
*
regs
)
{
{
struct
rt_signal_frame32
__user
*
sf
;
struct
rt_signal_frame32
__user
*
sf
;
unsigned
int
psr
,
pc
,
npc
,
u_ss_sp
;
unsigned
int
psr
,
pc
,
npc
;
compat_uptr_t
fpu_save
;
compat_uptr_t
fpu_save
;
compat_uptr_t
rwin_save
;
compat_uptr_t
rwin_save
;
mm_segment_t
old_fs
;
sigset_t
set
;
sigset_t
set
;
compat_sigset_t
seta
;
compat_sigset_t
seta
;
stack_t
st
;
int
err
,
i
;
int
err
,
i
;
/* Always make any pending restarted system calls return -EINTR */
/* Always make any pending restarted system calls return -EINTR */
...
@@ -295,20 +293,10 @@ asmlinkage void do_rt_sigreturn32(struct pt_regs *regs)
...
@@ -295,20 +293,10 @@ asmlinkage void do_rt_sigreturn32(struct pt_regs *regs)
if
(
!
err
&&
fpu_save
)
if
(
!
err
&&
fpu_save
)
err
|=
restore_fpu_state
(
regs
,
compat_ptr
(
fpu_save
));
err
|=
restore_fpu_state
(
regs
,
compat_ptr
(
fpu_save
));
err
|=
copy_from_user
(
&
seta
,
&
sf
->
mask
,
sizeof
(
compat_sigset_t
));
err
|=
copy_from_user
(
&
seta
,
&
sf
->
mask
,
sizeof
(
compat_sigset_t
));
err
|=
__get_user
(
u_ss_sp
,
&
sf
->
stack
.
ss_sp
);
err
|=
compat_restore_altstack
(
&
sf
->
stack
);
st
.
ss_sp
=
compat_ptr
(
u_ss_sp
);
err
|=
__get_user
(
st
.
ss_flags
,
&
sf
->
stack
.
ss_flags
);
err
|=
__get_user
(
st
.
ss_size
,
&
sf
->
stack
.
ss_size
);
if
(
err
)
if
(
err
)
goto
segv
;
goto
segv
;
/* It is more difficult to avoid calling this function than to
call it and ignore errors. */
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
do_sigaltstack
((
stack_t
__user
*
)
&
st
,
NULL
,
(
unsigned
long
)
sf
);
set_fs
(
old_fs
);
err
|=
__get_user
(
rwin_save
,
&
sf
->
rwin_save
);
err
|=
__get_user
(
rwin_save
,
&
sf
->
rwin_save
);
if
(
!
err
&&
rwin_save
)
{
if
(
!
err
&&
rwin_save
)
{
if
(
restore_rwin_state
(
compat_ptr
(
rwin_save
)))
if
(
restore_rwin_state
(
compat_ptr
(
rwin_save
)))
...
@@ -642,9 +630,7 @@ static int setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs,
...
@@ -642,9 +630,7 @@ static int setup_rt_frame32(struct k_sigaction *ka, struct pt_regs *regs,
err
|=
copy_siginfo_to_user32
(
&
sf
->
info
,
info
);
err
|=
copy_siginfo_to_user32
(
&
sf
->
info
,
info
);
/* Setup sigaltstack */
/* Setup sigaltstack */
err
|=
__put_user
(
current
->
sas_ss_sp
,
&
sf
->
stack
.
ss_sp
);
err
|=
__compat_save_altstack
(
&
sf
->
stack
,
regs
->
u_regs
[
UREG_FP
]);
err
|=
__put_user
(
sas_ss_flags
(
regs
->
u_regs
[
UREG_FP
]),
&
sf
->
stack
.
ss_flags
);
err
|=
__put_user
(
current
->
sas_ss_size
,
&
sf
->
stack
.
ss_size
);
switch
(
_NSIG_WORDS
)
{
switch
(
_NSIG_WORDS
)
{
case
4
:
seta
.
sig
[
7
]
=
(
oldset
->
sig
[
3
]
>>
32
);
case
4
:
seta
.
sig
[
7
]
=
(
oldset
->
sig
[
3
]
>>
32
);
...
@@ -856,29 +842,3 @@ asmlinkage int do_sys32_sigstack(u32 u_ssptr, u32 u_ossptr, unsigned long sp)
...
@@ -856,29 +842,3 @@ asmlinkage int do_sys32_sigstack(u32 u_ssptr, u32 u_ossptr, unsigned long sp)
out:
out:
return
ret
;
return
ret
;
}
}
asmlinkage
long
do_sys32_sigaltstack
(
u32
ussa
,
u32
uossa
,
unsigned
long
sp
)
{
stack_t
uss
,
uoss
;
u32
u_ss_sp
=
0
;
int
ret
;
mm_segment_t
old_fs
;
stack_t32
__user
*
uss32
=
compat_ptr
(
ussa
);
stack_t32
__user
*
uoss32
=
compat_ptr
(
uossa
);
if
(
ussa
&&
(
get_user
(
u_ss_sp
,
&
uss32
->
ss_sp
)
||
__get_user
(
uss
.
ss_flags
,
&
uss32
->
ss_flags
)
||
__get_user
(
uss
.
ss_size
,
&
uss32
->
ss_size
)))
return
-
EFAULT
;
uss
.
ss_sp
=
compat_ptr
(
u_ss_sp
);
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
ret
=
do_sigaltstack
(
ussa
?
(
stack_t
__user
*
)
&
uss
:
NULL
,
uossa
?
(
stack_t
__user
*
)
&
uoss
:
NULL
,
sp
);
set_fs
(
old_fs
);
if
(
!
ret
&&
uossa
&&
(
put_user
(
ptr_to_compat
(
uoss
.
ss_sp
),
&
uoss32
->
ss_sp
)
||
__put_user
(
uoss
.
ss_flags
,
&
uoss32
->
ss_flags
)
||
__put_user
(
uoss
.
ss_size
,
&
uoss32
->
ss_size
)))
return
-
EFAULT
;
return
ret
;
}
arch/sparc/kernel/signal_32.c
浏览文件 @
99b06feb
...
@@ -141,9 +141,7 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs)
...
@@ -141,9 +141,7 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs)
unsigned
int
psr
,
pc
,
npc
;
unsigned
int
psr
,
pc
,
npc
;
__siginfo_fpu_t
__user
*
fpu_save
;
__siginfo_fpu_t
__user
*
fpu_save
;
__siginfo_rwin_t
__user
*
rwin_save
;
__siginfo_rwin_t
__user
*
rwin_save
;
mm_segment_t
old_fs
;
sigset_t
set
;
sigset_t
set
;
stack_t
st
;
int
err
;
int
err
;
synchronize_user_stack
();
synchronize_user_stack
();
...
@@ -171,8 +169,7 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs)
...
@@ -171,8 +169,7 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs)
if
(
!
err
&&
fpu_save
)
if
(
!
err
&&
fpu_save
)
err
|=
restore_fpu_state
(
regs
,
fpu_save
);
err
|=
restore_fpu_state
(
regs
,
fpu_save
);
err
|=
__copy_from_user
(
&
set
,
&
sf
->
mask
,
sizeof
(
sigset_t
));
err
|=
__copy_from_user
(
&
set
,
&
sf
->
mask
,
sizeof
(
sigset_t
));
err
|=
restore_altstack
(
&
sf
->
stack
);
err
|=
__copy_from_user
(
&
st
,
&
sf
->
stack
,
sizeof
(
stack_t
));
if
(
err
)
if
(
err
)
goto
segv
;
goto
segv
;
...
@@ -180,14 +177,6 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs)
...
@@ -180,14 +177,6 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs)
regs
->
pc
=
pc
;
regs
->
pc
=
pc
;
regs
->
npc
=
npc
;
regs
->
npc
=
npc
;
/* It is more difficult to avoid calling this function than to
* call it and ignore errors.
*/
old_fs
=
get_fs
();
set_fs
(
KERNEL_DS
);
do_sigaltstack
((
const
stack_t
__user
*
)
&
st
,
NULL
,
(
unsigned
long
)
sf
);
set_fs
(
old_fs
);
err
|=
__get_user
(
rwin_save
,
&
sf
->
rwin_save
);
err
|=
__get_user
(
rwin_save
,
&
sf
->
rwin_save
);
if
(
!
err
&&
rwin_save
)
{
if
(
!
err
&&
rwin_save
)
{
if
(
restore_rwin_state
(
rwin_save
))
if
(
restore_rwin_state
(
rwin_save
))
...
@@ -391,9 +380,7 @@ static int setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
...
@@ -391,9 +380,7 @@ static int setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
err
|=
__copy_to_user
(
&
sf
->
mask
,
&
oldset
->
sig
[
0
],
sizeof
(
sigset_t
));
err
|=
__copy_to_user
(
&
sf
->
mask
,
&
oldset
->
sig
[
0
],
sizeof
(
sigset_t
));
/* Setup sigaltstack */
/* Setup sigaltstack */
err
|=
__put_user
(
current
->
sas_ss_sp
,
&
sf
->
stack
.
ss_sp
);
err
|=
__save_altstack
(
&
sf
->
stack
,
regs
->
u_regs
[
UREG_FP
]);
err
|=
__put_user
(
sas_ss_flags
(
regs
->
u_regs
[
UREG_FP
]),
&
sf
->
stack
.
ss_flags
);
err
|=
__put_user
(
current
->
sas_ss_size
,
&
sf
->
stack
.
ss_size
);
if
(
!
wsaved
)
{
if
(
!
wsaved
)
{
err
|=
__copy_to_user
(
sf
,
(
char
*
)
regs
->
u_regs
[
UREG_FP
],
err
|=
__copy_to_user
(
sf
,
(
char
*
)
regs
->
u_regs
[
UREG_FP
],
...
...
arch/sparc/kernel/signal_64.c
浏览文件 @
99b06feb
...
@@ -295,7 +295,8 @@ void do_rt_sigreturn(struct pt_regs *regs)
...
@@ -295,7 +295,8 @@ void do_rt_sigreturn(struct pt_regs *regs)
err
|=
restore_fpu_state
(
regs
,
fpu_save
);
err
|=
restore_fpu_state
(
regs
,
fpu_save
);
err
|=
__copy_from_user
(
&
set
,
&
sf
->
mask
,
sizeof
(
sigset_t
));
err
|=
__copy_from_user
(
&
set
,
&
sf
->
mask
,
sizeof
(
sigset_t
));
if
(
err
||
do_sigaltstack
(
&
sf
->
stack
,
NULL
,
(
unsigned
long
)
sf
)
==
-
EFAULT
)
err
|=
restore_altstack
(
&
sf
->
stack
);
if
(
err
)
goto
segv
;
goto
segv
;
err
|=
__get_user
(
rwin_save
,
&
sf
->
rwin_save
);
err
|=
__get_user
(
rwin_save
,
&
sf
->
rwin_save
);
...
@@ -403,9 +404,7 @@ setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
...
@@ -403,9 +404,7 @@ setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs,
}
}
/* Setup sigaltstack */
/* Setup sigaltstack */
err
|=
__put_user
(
current
->
sas_ss_sp
,
&
sf
->
stack
.
ss_sp
);
err
|=
__save_altstack
(
&
sf
->
stack
,
regs
->
u_regs
[
UREG_FP
]);
err
|=
__put_user
(
sas_ss_flags
(
regs
->
u_regs
[
UREG_FP
]),
&
sf
->
stack
.
ss_flags
);
err
|=
__put_user
(
current
->
sas_ss_size
,
&
sf
->
stack
.
ss_size
);
err
|=
copy_to_user
(
&
sf
->
mask
,
oldset
,
sizeof
(
sigset_t
));
err
|=
copy_to_user
(
&
sf
->
mask
,
oldset
,
sizeof
(
sigset_t
));
...
...
arch/sparc/kernel/syscalls.S
浏览文件 @
99b06feb
...
@@ -25,16 +25,10 @@ sys_nis_syscall:
...
@@ -25,16 +25,10 @@ sys_nis_syscall:
sys_memory_ordering
:
sys_memory_ordering
:
ba
,
pt
%
xcc
,
sparc_memory_ordering
ba
,
pt
%
xcc
,
sparc_memory_ordering
add
%
sp
,
PTREGS_OFF
,
%
o1
add
%
sp
,
PTREGS_OFF
,
%
o1
sys_sigaltstack
:
ba
,
pt
%
xcc
,
do_sigaltstack
add
%
i6
,
STACK_BIAS
,
%
o2
#ifdef CONFIG_COMPAT
#ifdef CONFIG_COMPAT
sys32_sigstack
:
sys32_sigstack
:
ba
,
pt
%
xcc
,
do_sys32_sigstack
ba
,
pt
%
xcc
,
do_sys32_sigstack
mov
%
i6
,
%
o2
mov
%
i6
,
%
o2
sys32_sigaltstack
:
ba
,
pt
%
xcc
,
do_sys32_sigaltstack
mov
%
i6
,
%
o2
#endif
#endif
.
align
32
.
align
32
#ifdef CONFIG_COMPAT
#ifdef CONFIG_COMPAT
...
...
arch/sparc/kernel/systbls_64.S
浏览文件 @
99b06feb
...
@@ -23,7 +23,7 @@ sys_call_table32:
...
@@ -23,7 +23,7 @@ sys_call_table32:
/*
10
*/
.
word
sys_unlink
,
sunos_execv
,
sys_chdir
,
sys_chown16
,
sys32_mknod
/*
10
*/
.
word
sys_unlink
,
sunos_execv
,
sys_chdir
,
sys_chown16
,
sys32_mknod
/*
15
*/
.
word
sys_chmod
,
sys_lchown16
,
sys_brk
,
sys_nis_syscall
,
sys32_lseek
/*
15
*/
.
word
sys_chmod
,
sys_lchown16
,
sys_brk
,
sys_nis_syscall
,
sys32_lseek
/*
20
*/
.
word
sys_getpid
,
sys_capget
,
sys_capset
,
sys_setuid16
,
sys_getuid16
/*
20
*/
.
word
sys_getpid
,
sys_capget
,
sys_capset
,
sys_setuid16
,
sys_getuid16
/*
25
*/
.
word
sys32_vmsplice
,
compat_sys_ptrace
,
sys_alarm
,
sys32
_sigaltstack
,
sys_pause
/*
25
*/
.
word
sys32_vmsplice
,
compat_sys_ptrace
,
sys_alarm
,
compat_sys
_sigaltstack
,
sys_pause
/*
30
*/
.
word
compat_sys_utime
,
sys_lchown
,
sys_fchown
,
sys32_access
,
sys32_nice
/*
30
*/
.
word
compat_sys_utime
,
sys_lchown
,
sys_fchown
,
sys32_access
,
sys32_nice
.
word
sys_chown
,
sys_sync
,
sys32_kill
,
compat_sys_newstat
,
sys32_sendfile
.
word
sys_chown
,
sys_sync
,
sys32_kill
,
compat_sys_newstat
,
sys32_sendfile
/*
40
*/
.
word
compat_sys_newlstat
,
sys_dup
,
sys_sparc_pipe
,
compat_sys_times
,
sys_getuid
/*
40
*/
.
word
compat_sys_newlstat
,
sys_dup
,
sys_sparc_pipe
,
compat_sys_times
,
sys_getuid
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录