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
285a7c9f
Commit
285a7c9f
authored
Dec 20, 2002
by
Miles Bader
Committed by
Linus Torvalds
Dec 20, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] Add v850 support for `sys_restart_syscall'
parent
31c9fa59
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
42 additions
and
25 deletions
+42
-25
arch/v850/kernel/entry.S
arch/v850/kernel/entry.S
+1
-1
arch/v850/kernel/signal.c
arch/v850/kernel/signal.c
+22
-13
include/asm-v850/current.h
include/asm-v850/current.h
+4
-1
include/asm-v850/processor.h
include/asm-v850/processor.h
+3
-1
include/asm-v850/thread_info.h
include/asm-v850/thread_info.h
+11
-9
include/asm-v850/unistd.h
include/asm-v850/unistd.h
+1
-0
No files found.
arch/v850/kernel/entry.S
View file @
285a7c9f
...
@@ -781,7 +781,7 @@ C_END(trap_table)
...
@@ -781,7 +781,7 @@ C_END(trap_table)
.
align
4
.
align
4
C_DATA
(
sys_call_table
):
C_DATA
(
sys_call_table
):
.
long
CSYM
(
sys_
ni_syscall
)
//
0
-
old
"setup()"
system
call
.
long
CSYM
(
sys_
restart_syscall
)
//
0
.
long
CSYM
(
sys_exit
)
.
long
CSYM
(
sys_exit
)
.
long
sys_fork_wrapper
.
long
sys_fork_wrapper
.
long
CSYM
(
sys_read
)
.
long
CSYM
(
sys_read
)
...
...
arch/v850/kernel/signal.c
View file @
285a7c9f
...
@@ -439,19 +439,23 @@ handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset,
...
@@ -439,19 +439,23 @@ handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset,
if
(
PT_REGS_SYSCALL
(
regs
))
{
if
(
PT_REGS_SYSCALL
(
regs
))
{
/* If so, check system call restarting.. */
/* If so, check system call restarting.. */
switch
(
regs
->
gpr
[
GPR_RVAL
])
{
switch
(
regs
->
gpr
[
GPR_RVAL
])
{
case
-
ERESTARTNOHAND
:
case
-
ERESTART_RESTARTBLOCK
:
current_thread_info
()
->
restart_block
.
fn
=
do_no_restart_syscall
;
/* fall through */
case
-
ERESTARTNOHAND
:
regs
->
gpr
[
GPR_RVAL
]
=
-
EINTR
;
break
;
case
-
ERESTARTSYS
:
if
(
!
(
ka
->
sa
.
sa_flags
&
SA_RESTART
))
{
regs
->
gpr
[
GPR_RVAL
]
=
-
EINTR
;
regs
->
gpr
[
GPR_RVAL
]
=
-
EINTR
;
break
;
break
;
}
case
-
ERESTARTSYS
:
if
(
!
(
ka
->
sa
.
sa_flags
&
SA_RESTART
))
{
regs
->
gpr
[
GPR_RVAL
]
=
-
EINTR
;
break
;
}
/* fallthrough */
/* fallthrough */
case
-
ERESTARTNOINTR
:
case
-
ERESTARTNOINTR
:
regs
->
gpr
[
12
]
=
PT_REGS_SYSCALL
(
regs
);
regs
->
gpr
[
12
]
=
PT_REGS_SYSCALL
(
regs
);
regs
->
pc
-=
4
;
/* Size of `trap 0' insn. */
regs
->
pc
-=
4
;
/* Size of `trap 0' insn. */
}
}
PT_REGS_SET_SYSCALL
(
regs
,
0
);
PT_REGS_SET_SYSCALL
(
regs
,
0
);
...
@@ -510,14 +514,19 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
...
@@ -510,14 +514,19 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
/* Did we come from a system call? */
/* Did we come from a system call? */
if
(
PT_REGS_SYSCALL
(
regs
))
{
if
(
PT_REGS_SYSCALL
(
regs
))
{
int
rval
=
(
int
)
regs
->
gpr
[
GPR_RVAL
];
/* Restart the system call - no handlers present */
/* Restart the system call - no handlers present */
if
(
r
egs
->
gpr
[
GPR_RVAL
]
==
(
v850_reg_t
)
-
ERESTARTNOHAND
||
if
(
r
val
==
-
ERESTARTNOHAND
regs
->
gpr
[
GPR_RVAL
]
==
(
v850_reg_t
)
-
ERESTARTSYS
||
||
rval
==
-
ERESTARTSYS
regs
->
gpr
[
GPR_RVAL
]
==
(
v850_reg_t
)
-
ERESTARTNOINTR
)
||
rval
==
-
ERESTARTNOINTR
)
{
{
regs
->
gpr
[
12
]
=
PT_REGS_SYSCALL
(
regs
);
regs
->
gpr
[
12
]
=
PT_REGS_SYSCALL
(
regs
);
regs
->
pc
-=
4
;
/* Size of `trap 0' insn. */
regs
->
pc
-=
4
;
/* Size of `trap 0' insn. */
}
}
else
if
(
rval
==
-
ERESTART_RESTARTBLOCK
)
{
regs
->
gpr
[
12
]
=
__NR_restart_syscall
;
regs
->
pc
-=
4
;
/* Size of `trap 0' insn. */
}
}
}
return
0
;
return
0
;
}
}
include/asm-v850/current.h
View file @
285a7c9f
...
@@ -14,8 +14,11 @@
...
@@ -14,8 +14,11 @@
#ifndef __V850_CURRENT_H__
#ifndef __V850_CURRENT_H__
#define __V850_CURRENT_H__
#define __V850_CURRENT_H__
#ifndef __ASSEMBLY__
/* <linux/thread_info.h> is not asm-safe. */
#include <linux/thread_info.h>
#endif
#include <asm/macrology.h>
#include <asm/macrology.h>
#include <asm/thread_info.h>
/* Register used to hold the current task pointer while in the kernel.
/* Register used to hold the current task pointer while in the kernel.
...
...
include/asm-v850/processor.h
View file @
285a7c9f
...
@@ -15,9 +15,11 @@
...
@@ -15,9 +15,11 @@
#define __V850_PROCESSOR_H__
#define __V850_PROCESSOR_H__
#include <linux/config.h>
#include <linux/config.h>
#ifndef __ASSEMBLY__
/* <linux/thread_info.h> is not asm-safe. */
#include <linux/thread_info.h>
#endif
#include <asm/ptrace.h>
#include <asm/ptrace.h>
#include <asm/thread_info.h>
#include <asm/entry.h>
#include <asm/entry.h>
/* Some code expects `segment' stuff to be defined here. */
/* Some code expects `segment' stuff to be defined here. */
...
...
include/asm-v850/thread_info.h
View file @
285a7c9f
...
@@ -31,15 +31,19 @@ struct thread_info {
...
@@ -31,15 +31,19 @@ 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) \
{ \
{ \
.task = &tsk, \
.task = &tsk, \
.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)
...
@@ -67,8 +71,6 @@ struct thread_info {
...
@@ -67,8 +71,6 @@ struct thread_info {
#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-v850/unistd.h
View file @
285a7c9f
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#include <asm/clinkage.h>
#include <asm/clinkage.h>
#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