Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
7b3e2fc8
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
7b3e2fc8
编写于
2月 08, 2006
作者:
R
Ralf Baechle
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[MIPS] Add support for TIF_RESTORE_SIGMASK.
Signed-off-by:
N
Ralf Baechle
<
ralf@linux-mips.org
>
---
上级
ac171c46
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
62 addition
and
46 deletion
+62
-46
arch/mips/kernel/process.c
arch/mips/kernel/process.c
+2
-2
arch/mips/kernel/signal.c
arch/mips/kernel/signal.c
+50
-36
arch/mips/kernel/signal32.c
arch/mips/kernel/signal32.c
+4
-4
arch/mips/kernel/signal_n32.c
arch/mips/kernel/signal_n32.c
+2
-2
include/asm-mips/abi.h
include/asm-mips/abi.h
+2
-2
include/asm-mips/thread_info.h
include/asm-mips/thread_info.h
+2
-0
未找到文件。
arch/mips/kernel/process.c
浏览文件 @
7b3e2fc8
...
...
@@ -58,8 +58,8 @@ ATTRIB_NORET void cpu_idle(void)
}
}
extern
int
do_signal
(
s
igset_t
*
oldset
,
s
truct
pt_regs
*
regs
);
extern
int
do_signal32
(
s
igset_t
*
oldset
,
s
truct
pt_regs
*
regs
);
extern
int
do_signal
(
struct
pt_regs
*
regs
);
extern
int
do_signal32
(
struct
pt_regs
*
regs
);
/*
* Native o32 and N64 ABI without DSP ASE
...
...
arch/mips/kernel/signal.c
浏览文件 @
7b3e2fc8
...
...
@@ -39,8 +39,6 @@
#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
int
do_signal
(
sigset_t
*
oldset
,
struct
pt_regs
*
regs
);
/*
* Atomically swap in the new signal mask, and wait for a signal.
*/
...
...
@@ -50,7 +48,7 @@ save_static_function(sys_sigsuspend);
__attribute_used__
noinline
static
int
_sys_sigsuspend
(
nabi_no_regargs
struct
pt_regs
regs
)
{
sigset_t
saveset
,
newset
;
sigset_t
newset
;
sigset_t
__user
*
uset
;
uset
=
(
sigset_t
__user
*
)
regs
.
regs
[
4
];
...
...
@@ -59,19 +57,15 @@ _sys_sigsuspend(nabi_no_regargs struct pt_regs regs)
sigdelsetmask
(
&
newset
,
~
_BLOCKABLE
);
spin_lock_irq
(
&
current
->
sighand
->
siglock
);
saveset
=
current
->
blocked
;
current
->
saved_sigmask
=
current
->
blocked
;
current
->
blocked
=
newset
;
recalc_sigpending
();
spin_unlock_irq
(
&
current
->
sighand
->
siglock
);
regs
.
regs
[
2
]
=
EINTR
;
regs
.
regs
[
7
]
=
1
;
while
(
1
)
{
current
->
state
=
TASK_INTERRUPTIBLE
;
schedule
();
if
(
do_signal
(
&
saveset
,
&
regs
))
return
-
EINTR
;
}
current
->
state
=
TASK_INTERRUPTIBLE
;
schedule
();
set_thread_flag
(
TIF_RESTORE_SIGMASK
);
return
-
ERESTARTNOHAND
;
}
#endif
...
...
@@ -79,7 +73,7 @@ save_static_function(sys_rt_sigsuspend);
__attribute_used__
noinline
static
int
_sys_rt_sigsuspend
(
nabi_no_regargs
struct
pt_regs
regs
)
{
sigset_t
saveset
,
newset
;
sigset_t
newset
;
sigset_t
__user
*
unewset
;
size_t
sigsetsize
;
...
...
@@ -94,19 +88,15 @@ _sys_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
sigdelsetmask
(
&
newset
,
~
_BLOCKABLE
);
spin_lock_irq
(
&
current
->
sighand
->
siglock
);
saveset
=
current
->
blocked
;
current
->
saved_sigmask
=
current
->
blocked
;
current
->
blocked
=
newset
;
recalc_sigpending
();
spin_unlock_irq
(
&
current
->
sighand
->
siglock
);
regs
.
regs
[
2
]
=
EINTR
;
regs
.
regs
[
7
]
=
1
;
while
(
1
)
{
current
->
state
=
TASK_INTERRUPTIBLE
;
schedule
();
if
(
do_signal
(
&
saveset
,
&
regs
))
return
-
EINTR
;
}
current
->
state
=
TASK_INTERRUPTIBLE
;
schedule
();
set_thread_flag
(
TIF_RESTORE_SIGMASK
);
return
-
ERESTARTNOHAND
;
}
#ifdef CONFIG_TRAD_SIGNALS
...
...
@@ -315,11 +305,11 @@ int setup_frame(struct k_sigaction * ka, struct pt_regs *regs,
current
->
comm
,
current
->
pid
,
frame
,
regs
->
cp0_epc
,
frame
->
regs
[
31
]);
#endif
return
1
;
return
0
;
give_sigsegv:
force_sigsegv
(
signr
,
current
);
return
0
;
return
-
EFAULT
;
}
#endif
...
...
@@ -375,11 +365,11 @@ int setup_rt_frame(struct k_sigaction * ka, struct pt_regs *regs,
current
->
comm
,
current
->
pid
,
frame
,
regs
->
cp0_epc
,
regs
->
regs
[
31
]);
#endif
return
1
;
return
0
;
give_sigsegv:
force_sigsegv
(
signr
,
current
);
return
0
;
return
-
EFAULT
;
}
static
inline
int
handle_signal
(
unsigned
long
sig
,
siginfo_t
*
info
,
...
...
@@ -393,7 +383,7 @@ static inline int handle_signal(unsigned long sig, siginfo_t *info,
regs
->
regs
[
2
]
=
EINTR
;
break
;
case
ERESTARTSYS
:
if
(
!
(
ka
->
sa
.
sa_flags
&
SA_RESTART
))
{
if
(
!
(
ka
->
sa
.
sa_flags
&
SA_RESTART
))
{
regs
->
regs
[
2
]
=
EINTR
;
break
;
}
...
...
@@ -420,9 +410,10 @@ static inline int handle_signal(unsigned long sig, siginfo_t *info,
return
ret
;
}
int
do_signal
(
s
igset_t
*
oldset
,
s
truct
pt_regs
*
regs
)
int
do_signal
(
struct
pt_regs
*
regs
)
{
struct
k_sigaction
ka
;
sigset_t
*
oldset
;
siginfo_t
info
;
int
signr
;
...
...
@@ -437,12 +428,26 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
if
(
try_to_freeze
())
goto
no_signal
;
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
)
return
handle_signal
(
signr
,
&
info
,
&
ka
,
oldset
,
regs
);
if
(
signr
>
0
)
{
/* Whee! Actually deliver the signal. */
if
(
handle_signal
(
signr
,
&
info
,
&
ka
,
oldset
,
regs
)
==
0
)
{
/*
* A signal was successfully delivered; the saved
* sigmask will have been stored in the signal frame,
* and will be restored by sigreturn, so we can simply
* clear the TIF_RESTORE_SIGMASK flag.
*/
if
(
test_thread_flag
(
TIF_RESTORE_SIGMASK
))
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
}
}
no_signal:
/*
...
...
@@ -463,18 +468,27 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
regs
->
cp0_epc
-=
4
;
}
}
/*
* If there's no signal to deliver, we just put the saved sigmask
* back
*/
if
(
test_thread_flag
(
TIF_RESTORE_SIGMASK
))
{
clear_thread_flag
(
TIF_RESTORE_SIGMASK
);
sigprocmask
(
SIG_SETMASK
,
&
current
->
saved_sigmask
,
NULL
);
}
return
0
;
}
/*
* notification of userspace execution resumption
* - triggered by
current->work.notify_resume
* - triggered by
the TIF_WORK_MASK flags
*/
asmlinkage
void
do_notify_resume
(
struct
pt_regs
*
regs
,
sigset_t
*
oldset
,
asmlinkage
void
do_notify_resume
(
struct
pt_regs
*
regs
,
void
*
unused
,
__u32
thread_info_flags
)
{
/* deal with pending signal delivery */
if
(
thread_info_flags
&
_TIF_SIGPENDING
)
{
current
->
thread
.
abi
->
do_signal
(
oldset
,
regs
);
}
if
(
thread_info_flags
&
(
_TIF_SIGPENDING
|
_TIF_RESTORE_SIGMASK
))
current
->
thread
.
abi
->
do_signal
(
regs
);
}
arch/mips/kernel/signal32.c
浏览文件 @
7b3e2fc8
...
...
@@ -694,11 +694,11 @@ int setup_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
current
->
comm
,
current
->
pid
,
frame
,
regs
->
cp0_epc
,
frame
->
sf_code
);
#endif
return
1
;
return
0
;
give_sigsegv:
force_sigsegv
(
signr
,
current
);
return
0
;
return
-
EFAULT
;
}
int
setup_rt_frame_32
(
struct
k_sigaction
*
ka
,
struct
pt_regs
*
regs
,
...
...
@@ -765,11 +765,11 @@ int setup_rt_frame_32(struct k_sigaction * ka, struct pt_regs *regs,
current
->
comm
,
current
->
pid
,
frame
,
regs
->
cp0_epc
,
frame
->
rs_code
);
#endif
return
1
;
return
0
;
give_sigsegv:
force_sigsegv
(
signr
,
current
);
return
0
;
return
-
EFAULT
;
}
static
inline
int
handle_signal
(
unsigned
long
sig
,
siginfo_t
*
info
,
...
...
arch/mips/kernel/signal_n32.c
浏览文件 @
7b3e2fc8
...
...
@@ -186,9 +186,9 @@ int setup_rt_frame_n32(struct k_sigaction * ka,
current
->
comm
,
current
->
pid
,
frame
,
regs
->
cp0_epc
,
regs
->
regs
[
31
]);
#endif
return
1
;
return
0
;
give_sigsegv:
force_sigsegv
(
signr
,
current
);
return
0
;
return
-
EFAULT
;
}
include/asm-mips/abi.h
浏览文件 @
7b3e2fc8
...
...
@@ -3,7 +3,7 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2005
by Ralf Baechle
* Copyright (C) 2005
, 06 by Ralf Baechle (ralf@linux-mips.org)
* Copyright (C) 2005 MIPS Technologies, Inc.
*/
#ifndef _ASM_ABI_H
...
...
@@ -13,7 +13,7 @@
#include <asm/siginfo.h>
struct
mips_abi
{
int
(
*
const
do_signal
)(
s
igset_t
*
oldset
,
s
truct
pt_regs
*
regs
);
int
(
*
const
do_signal
)(
struct
pt_regs
*
regs
);
int
(
*
const
setup_frame
)(
struct
k_sigaction
*
ka
,
struct
pt_regs
*
regs
,
int
signr
,
sigset_t
*
set
);
...
...
include/asm-mips/thread_info.h
浏览文件 @
7b3e2fc8
...
...
@@ -114,6 +114,7 @@ register struct thread_info *__current_thread_info __asm__("$28");
#define TIF_NEED_RESCHED 3
/* rescheduling necessary */
#define TIF_SYSCALL_AUDIT 4
/* syscall auditing active */
#define TIF_SECCOMP 5
/* secure computing */
#define TIF_RESTORE_SIGMASK 9
/* restore signal mask in do_signal() */
#define TIF_USEDFPU 16
/* FPU was used by this task this quantum (SMP) */
#define TIF_POLLING_NRFLAG 17
/* true if poll_idle() is polling TIF_NEED_RESCHED */
#define TIF_MEMDIE 18
...
...
@@ -125,6 +126,7 @@ register struct thread_info *__current_thread_info __asm__("$28");
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
#define _TIF_SECCOMP (1<<TIF_SECCOMP)
#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
#define _TIF_USEDFPU (1<<TIF_USEDFPU)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录