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
Kirill Smelkov
linux
Commits
88e127a8
Commit
88e127a8
authored
Dec 08, 2002
by
Paul Mackerras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PPC32: add support for restarting syscalls with ERESTART_RESTARTBLOCK
parent
d6162f7e
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
19 deletions
+24
-19
arch/ppc/kernel/misc.S
arch/ppc/kernel/misc.S
+1
-1
arch/ppc/kernel/signal.c
arch/ppc/kernel/signal.c
+16
-7
include/asm-ppc/errno.h
include/asm-ppc/errno.h
+1
-7
include/asm-ppc/thread_info.h
include/asm-ppc/thread_info.h
+5
-3
include/asm-ppc/unistd.h
include/asm-ppc/unistd.h
+1
-1
No files found.
arch/ppc/kernel/misc.S
View file @
88e127a8
...
@@ -1056,7 +1056,7 @@ SYSCALL(waitpid)
...
@@ -1056,7 +1056,7 @@ SYSCALL(waitpid)
.
data
.
data
.
align
4
.
align
4
_GLOBAL
(
sys_call_table
)
_GLOBAL
(
sys_call_table
)
.
long
sys_
ni_syscall
/*
0
-
old
"setup()"
system
call
*/
.
long
sys_
restart_syscall
/*
0
*/
.
long
sys_exit
.
long
sys_exit
.
long
ppc_fork
.
long
ppc_fork
.
long
sys_read
.
long
sys_read
...
...
arch/ppc/kernel/signal.c
View file @
88e127a8
...
@@ -393,8 +393,12 @@ handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset,
...
@@ -393,8 +393,12 @@ handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset,
if
(
TRAP
(
regs
)
==
0x0C00
/* System Call! */
if
(
TRAP
(
regs
)
==
0x0C00
/* System Call! */
&&
((
int
)
regs
->
result
==
-
ERESTARTNOHAND
||
&&
((
int
)
regs
->
result
==
-
ERESTARTNOHAND
||
(
int
)
regs
->
result
==
-
ERESTART_RESTARTBLOCK
||
((
int
)
regs
->
result
==
-
ERESTARTSYS
&&
((
int
)
regs
->
result
==
-
ERESTARTSYS
&&
!
(
ka
->
sa
.
sa_flags
&
SA_RESTART
))))
{
!
(
ka
->
sa
.
sa_flags
&
SA_RESTART
))))
{
if
((
int
)
regs
->
result
==
-
ERESTART_RESTARTBLOCK
)
current_thread_info
()
->
restart_block
.
fn
=
do_no_restart_syscall
;
regs
->
result
=
-
EINTR
;
regs
->
result
=
-
EINTR
;
regs
->
gpr
[
3
]
=
EINTR
;
regs
->
gpr
[
3
]
=
EINTR
;
regs
->
ccr
|=
0x10000000
;
regs
->
ccr
|=
0x10000000
;
...
@@ -494,13 +498,18 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
...
@@ -494,13 +498,18 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs)
handle_signal
(
signr
,
&
info
,
oldset
,
regs
,
&
newsp
,
frame
);
handle_signal
(
signr
,
&
info
,
oldset
,
regs
,
&
newsp
,
frame
);
}
}
if
(
TRAP
(
regs
)
==
0x0C00
/* System Call! */
&&
if
(
TRAP
(
regs
)
==
0x0C00
)
{
/* System Call! */
((
int
)
regs
->
result
==
-
ERESTARTNOHAND
||
if
((
int
)
regs
->
result
==
-
ERESTARTNOHAND
||
(
int
)
regs
->
result
==
-
ERESTARTSYS
||
(
int
)
regs
->
result
==
-
ERESTARTSYS
||
(
int
)
regs
->
result
==
-
ERESTARTNOINTR
)
)
{
(
int
)
regs
->
result
==
-
ERESTARTNOINTR
)
{
regs
->
gpr
[
3
]
=
regs
->
orig_gpr3
;
regs
->
gpr
[
3
]
=
regs
->
orig_gpr3
;
regs
->
nip
-=
4
;
/* Back up & retry system call */
regs
->
nip
-=
4
;
/* Back up & retry system call */
regs
->
result
=
0
;
regs
->
result
=
0
;
}
else
if
((
int
)
regs
->
result
==
-
ERESTART_RESTARTBLOCK
)
{
regs
->
gpr
[
0
]
=
__NR_restart_syscall
;
regs
->
nip
-=
4
;
regs
->
result
=
0
;
}
}
}
if
(
newsp
==
frame
)
if
(
newsp
==
frame
)
...
...
include/asm-ppc/errno.h
View file @
88e127a8
...
@@ -6,12 +6,6 @@
...
@@ -6,12 +6,6 @@
#undef EDEADLOCK
#undef EDEADLOCK
#define EDEADLOCK 58
/* File locking deadlock error */
#define EDEADLOCK 58
/* File locking deadlock error */
/* Should never be seen by user programs */
#define _LAST_ERRNO 516
#define ERESTARTSYS 512
#define ERESTARTNOINTR 513
#define ERESTARTNOHAND 514
/* restart if no handler.. */
#define ENOIOCTLCMD 515
/* No ioctl command */
#define _LAST_ERRNO 515
#endif
#endif
include/asm-ppc/thread_info.h
View file @
88e127a8
...
@@ -23,6 +23,7 @@ struct thread_info {
...
@@ -23,6 +23,7 @@ struct thread_info {
unsigned
long
flags
;
/* low level flags */
unsigned
long
flags
;
/* low level flags */
int
cpu
;
/* cpu we're on */
int
cpu
;
/* cpu we're on */
int
preempt_count
;
int
preempt_count
;
struct
restart_block
restart_block
;
};
};
#define INIT_THREAD_INFO(tsk) \
#define INIT_THREAD_INFO(tsk) \
...
@@ -31,7 +32,10 @@ struct thread_info {
...
@@ -31,7 +32,10 @@ struct thread_info {
.exec_domain = &default_exec_domain, \
.exec_domain = &default_exec_domain, \
.flags = 0, \
.flags = 0, \
.cpu = 0, \
.cpu = 0, \
.preempt_count = 1 \
.preempt_count = 1, \
.restart_block = { \
.fn = do_no_restart_syscall, \
}, \
}
}
#define init_thread_info (init_thread_union.thread_info)
#define init_thread_info (init_thread_union.thread_info)
...
@@ -70,8 +74,6 @@ static inline struct thread_info *current_thread_info(void)
...
@@ -70,8 +74,6 @@ static inline struct thread_info *current_thread_info(void)
#define TI_FLAGS 8
#define TI_FLAGS 8
#define TI_CPU 12
#define TI_CPU 12
#define TI_PREEMPT 16
#define TI_PREEMPT 16
#define TI_SOFTIRQ 20
#define TI_HARDIRQ 24
#define PREEMPT_ACTIVE 0x4000000
#define PREEMPT_ACTIVE 0x4000000
...
...
include/asm-ppc/unistd.h
View file @
88e127a8
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
/*
/*
* This file contains the system call numbers.
* This file contains the system call numbers.
*/
*/
#define __NR_restart_syscall 0
#define __NR_exit 1
#define __NR_exit 1
#define __NR_fork 2
#define __NR_fork 2
#define __NR_read 3
#define __NR_read 3
...
...
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