Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
7ae4e32a
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7ae4e32a
编写于
4月 22, 2012
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
h8300: switch to saved_sigmask-based sigsuspend/rt_sigsuspend
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
8b6c3309
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
59 deletion
+21
-59
arch/h8300/include/asm/unistd.h
arch/h8300/include/asm/unistd.h
+1
-0
arch/h8300/kernel/signal.c
arch/h8300/kernel/signal.c
+20
-53
arch/h8300/kernel/syscalls.S
arch/h8300/kernel/syscalls.S
+0
-6
未找到文件。
arch/h8300/include/asm/unistd.h
浏览文件 @
7ae4e32a
...
...
@@ -356,6 +356,7 @@
#define __ARCH_WANT_SYS_SIGPENDING
#define __ARCH_WANT_SYS_SIGPROCMASK
#define __ARCH_WANT_SYS_RT_SIGACTION
#define __ARCH_WANT_SYS_RT_SIGSUSPEND
/*
* "Conditional" syscalls
...
...
arch/h8300/kernel/signal.c
浏览文件 @
7ae4e32a
...
...
@@ -49,56 +49,15 @@
#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
asmlinkage
int
do_signal
(
struct
pt_regs
*
regs
,
sigset_t
*
oldset
);
/*
* Atomically swap in the new signal mask, and wait for a signal.
*/
asmlinkage
int
do_sigsuspend
(
struct
pt_regs
*
regs
)
{
old_sigset_t
mask
=
regs
->
er3
;
sigset_t
saveset
,
blocked
;
saveset
=
current
->
blocked
;
mask
&=
_BLOCKABLE
;
siginitset
(
&
blocked
,
mask
);
set_current_blocked
(
&
blocked
);
regs
->
er0
=
-
EINTR
;
while
(
1
)
{
current
->
state
=
TASK_INTERRUPTIBLE
;
schedule
();
if
(
do_signal
(
regs
,
&
saveset
))
return
-
EINTR
;
}
}
asmlinkage
int
do_rt_sigsuspend
(
struct
pt_regs
*
regs
)
sys_sigsuspend
(
int
unused1
,
int
unused2
,
old_sigset_t
mask
)
{
sigset_t
*
unewset
=
(
sigset_t
*
)
regs
->
er1
;
size_t
sigsetsize
=
(
size_t
)
regs
->
er2
;
sigset_t
saveset
,
newset
;
/* XXX: Don't preclude handling different sized sigset_t's. */
if
(
sigsetsize
!=
sizeof
(
sigset_t
))
return
-
EINVAL
;
if
(
copy_from_user
(
&
newset
,
unewset
,
sizeof
(
newset
)))
return
-
EFAULT
;
sigdelsetmask
(
&
newset
,
~
_BLOCKABLE
);
saveset
=
current
->
blocked
;
set_current_blocked
(
&
newset
);
regs
->
er0
=
-
EINTR
;
while
(
1
)
{
current
->
state
=
TASK_INTERRUPTIBLE
;
schedule
();
if
(
do_signal
(
regs
,
&
saveset
))
return
-
EINTR
;
}
sigset_t
blocked
;
siginitset
(
&
blocked
,
mask
);
return
sigsuspend
(
&
blocked
);
}
asmlinkage
int
...
...
@@ -482,8 +441,10 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
else
ret
=
setup_frame
(
sig
,
ka
,
oldset
,
regs
);
if
(
!
ret
)
if
(
!
ret
)
{
block_sigmask
(
ka
,
sig
);
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
}
}
/*
...
...
@@ -491,11 +452,12 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
* want to handle. Thus you cannot kill init even with a SIGKILL even by
* mistake.
*/
asmlinkage
int
do_signal
(
struct
pt_regs
*
regs
,
sigset_t
*
oldset
)
statis
void
do_signal
(
struct
pt_regs
*
regs
)
{
siginfo_t
info
;
int
signr
;
struct
k_sigaction
ka
;
sigset_t
*
oldset
;
/*
* We want the common case to go fast, which
...
...
@@ -504,21 +466,23 @@ asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset)
* if so.
*/
if
((
regs
->
ccr
&
0x10
))
return
1
;
return
;
if
(
try_to_freeze
())
goto
no_signal
;
current
->
thread
.
esp0
=
(
unsigned
long
)
regs
;
if
(
!
oldset
)
if
(
test_thread_flag
(
TIF_RESTORE_SIGMASK
))
oldset
=
&
current
->
saved_sigmask
;
else
oldset
=
&
current
->
blocked
;
signr
=
get_signal_to_deliver
(
&
info
,
&
ka
,
regs
,
NULL
);
if
(
signr
>
0
)
{
/* Whee! Actually deliver the signal. */
handle_signal
(
signr
,
&
info
,
&
ka
,
oldset
,
regs
);
return
1
;
return
;
}
no_signal:
/* Did we come from a system call? */
...
...
@@ -535,13 +499,16 @@ asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset)
regs
->
pc
-=
2
;
}
}
return
0
;
/* If there's no signal to deliver, we just restore the saved mask. */
if
(
test_and_clear_thread_flag
(
TIF_RESTORE_SIGMASK
))
set_current_blocked
(
&
current
->
saved_sigmask
);
}
asmlinkage
void
do_notify_resume
(
struct
pt_regs
*
regs
,
u32
thread_info_flags
)
{
if
(
thread_info_flags
&
(
_TIF_SIGPENDING
|
_TIF_RESTORE_SIGMASK
)
)
do_signal
(
regs
,
NULL
);
if
(
thread_info_flags
&
_TIF_SIGPENDING
)
do_signal
(
regs
);
if
(
thread_info_flags
&
_TIF_NOTIFY_RESUME
)
{
clear_thread_flag
(
TIF_NOTIFY_RESUME
);
...
...
arch/h8300/kernel/syscalls.S
浏览文件 @
7ae4e32a
...
...
@@ -343,12 +343,6 @@ SYMBOL_NAME_LABEL(sys_call_table)
SYMBOL_NAME_LABEL
(
sys_clone
)
call_sp
h8300_clone
SYMBOL_NAME_LABEL
(
sys_sigsuspend
)
call_sp
do_sigsuspend
SYMBOL_NAME_LABEL
(
sys_rt_sigsuspend
)
call_sp
do_rt_sigsuspend
SYMBOL_NAME_LABEL
(
sys_sigreturn
)
call_sp
do_sigreturn
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录