Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
f8b890ab
Commit
f8b890ab
authored
Sep 12, 2008
by
Paul Mundt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sh: Flag T-bit for syscall restart.
Signed-off-by:
Paul Mundt
<
lethal@linux-sh.org
>
parent
cb700aa4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
22 deletions
+31
-22
arch/sh/kernel/signal_32.c
arch/sh/kernel/signal_32.c
+31
-22
No files found.
arch/sh/kernel/signal_32.c
View file @
f8b890ab
...
...
@@ -490,37 +490,43 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
return
-
EFAULT
;
}
static
inline
void
handle_syscall_restart
(
unsigned
long
save_r0
,
struct
pt_regs
*
regs
,
struct
sigaction
*
sa
)
{
/* If we're not from a syscall, bail out */
if
(
regs
->
tra
<
0
)
return
;
/* check for system call restart.. */
switch
(
regs
->
regs
[
0
])
{
case
-
ERESTART_RESTARTBLOCK
:
case
-
ERESTARTNOHAND
:
no_system_call_restart:
regs
->
regs
[
0
]
=
-
EINTR
;
regs
->
sr
|=
1
;
break
;
case
-
ERESTARTSYS
:
if
(
!
(
sa
->
sa_flags
&
SA_RESTART
))
goto
no_system_call_restart
;
/* fallthrough */
case
-
ERESTARTNOINTR
:
regs
->
regs
[
0
]
=
save_r0
;
regs
->
pc
-=
instruction_size
(
ctrl_inw
(
regs
->
pc
-
4
));
break
;
}
}
/*
* OK, we're invoking a handler
*/
static
int
handle_signal
(
unsigned
long
sig
,
struct
k_sigaction
*
ka
,
siginfo_t
*
info
,
sigset_t
*
oldset
,
struct
pt_regs
*
regs
,
unsigned
int
save_r0
)
{
int
ret
;
/* Are we from a system call? */
if
(
regs
->
tra
>=
0
)
{
/* If so, check system call restarting.. */
switch
(
regs
->
regs
[
0
])
{
case
-
ERESTART_RESTARTBLOCK
:
case
-
ERESTARTNOHAND
:
no_system_call_restart:
regs
->
regs
[
0
]
=
-
EINTR
;
break
;
case
-
ERESTARTSYS
:
if
(
!
(
ka
->
sa
.
sa_flags
&
SA_RESTART
))
goto
no_system_call_restart
;
/* fallthrough */
case
-
ERESTARTNOINTR
:
regs
->
regs
[
0
]
=
save_r0
;
regs
->
pc
-=
instruction_size
(
ctrl_inw
(
regs
->
pc
-
4
));
break
;
}
}
/* Set up the stack frame */
if
(
ka
->
sa
.
sa_flags
&
SA_SIGINFO
)
...
...
@@ -578,6 +584,9 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0)
signr
=
get_signal_to_deliver
(
&
info
,
&
ka
,
regs
,
NULL
);
if
(
signr
>
0
)
{
if
(
regs
->
sr
&
1
)
handle_syscall_restart
(
save_r0
,
regs
,
&
ka
.
sa
);
/* Whee! Actually deliver the signal. */
if
(
handle_signal
(
signr
,
&
ka
,
&
info
,
oldset
,
regs
,
save_r0
)
==
0
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment