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
1703a219
Commit
1703a219
authored
Oct 03, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cris: switch to generic kernel_execve/sys_execve
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
69b58a67
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
6 additions
and
65 deletions
+6
-65
arch/cris/Kconfig
arch/cris/Kconfig
+1
-0
arch/cris/arch-v10/kernel/entry.S
arch/cris/arch-v10/kernel/entry.S
+2
-9
arch/cris/arch-v10/kernel/process.c
arch/cris/arch-v10/kernel/process.c
+0
-23
arch/cris/arch-v32/kernel/entry.S
arch/cris/arch-v32/kernel/entry.S
+2
-11
arch/cris/arch-v32/kernel/process.c
arch/cris/arch-v32/kernel/process.c
+0
-22
arch/cris/include/asm/unistd.h
arch/cris/include/asm/unistd.h
+1
-0
No files found.
arch/cris/Kconfig
View file @
1703a219
...
@@ -50,6 +50,7 @@ config CRIS
...
@@ -50,6 +50,7 @@ config CRIS
select GENERIC_CMOS_UPDATE
select GENERIC_CMOS_UPDATE
select MODULES_USE_ELF_RELA
select MODULES_USE_ELF_RELA
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_THREAD
select GENERIC_KERNEL_EXECVE
config HZ
config HZ
int
int
...
...
arch/cris/arch-v10/kernel/entry.S
View file @
1703a219
...
@@ -87,8 +87,8 @@ ret_from_kernel_thread:
...
@@ -87,8 +87,8 @@ ret_from_kernel_thread:
jsr
schedule_tail
jsr
schedule_tail
move.d
$r2
,
$r10
; argument is here
move.d
$r2
,
$r10
; argument is here
jsr
$r1
; call the payload
jsr
$r1
; call the payload
moveq
0
,
$r
10
moveq
0
,
$r
9
; no syscall restarts, TYVM...
jsr
sys_exit
; never returns
ba
ret_from_sys_call
ret_from_intr
:
ret_from_intr
:
;; check for resched if preemptive kernel or if we're going back to user-mode
;; check for resched if preemptive kernel or if we're going back to user-mode
...
@@ -594,13 +594,6 @@ _ugdb_handle_breakpoint:
...
@@ -594,13 +594,6 @@ _ugdb_handle_breakpoint:
ba
do_sigtrap
; SIGTRAP the offending process.
ba
do_sigtrap
; SIGTRAP the offending process.
pop
$dccr
; Restore dccr in delay slot.
pop
$dccr
; Restore dccr in delay slot.
.
global
kernel_execve
kernel_execve
:
move.d
__NR_execve
,
$r9
break
13
ret
nop
.
data
.
data
hw_bp_trigs
:
hw_bp_trigs
:
...
...
arch/cris/arch-v10/kernel/process.c
View file @
1703a219
...
@@ -167,29 +167,6 @@ asmlinkage int sys_vfork(void)
...
@@ -167,29 +167,6 @@ asmlinkage int sys_vfork(void)
return
do_fork
(
CLONE_VFORK
|
CLONE_VM
|
SIGCHLD
,
rdusp
(),
current_pt_regs
(),
0
,
NULL
,
NULL
);
return
do_fork
(
CLONE_VFORK
|
CLONE_VM
|
SIGCHLD
,
rdusp
(),
current_pt_regs
(),
0
,
NULL
,
NULL
);
}
}
/*
* sys_execve() executes a new program.
*/
asmlinkage
int
sys_execve
(
const
char
*
fname
,
const
char
*
const
*
argv
,
const
char
*
const
*
envp
,
long
r13
,
long
mof
,
long
srp
,
struct
pt_regs
*
regs
)
{
int
error
;
struct
filename
*
filename
;
filename
=
getname
(
fname
);
error
=
PTR_ERR
(
filename
);
if
(
IS_ERR
(
filename
))
goto
out
;
error
=
do_execve
(
filename
->
name
,
argv
,
envp
,
regs
);
putname
(
filename
);
out:
return
error
;
}
unsigned
long
get_wchan
(
struct
task_struct
*
p
)
unsigned
long
get_wchan
(
struct
task_struct
*
p
)
{
{
#if 0
#if 0
...
...
arch/cris/arch-v32/kernel/entry.S
View file @
1703a219
...
@@ -92,8 +92,8 @@ ret_from_kernel_thread:
...
@@ -92,8 +92,8 @@ ret_from_kernel_thread:
move.d
$r2
,
$r10
move.d
$r2
,
$r10
jsr
$r1
jsr
$r1
nop
nop
moveq
0
,
$r
10
moveq
0
,
$r
9
; no syscall restarts, TYVM...
jsr
sys_exit
ba
ret_from_sys_call
nop
nop
.
size
ret_from_kernel_thread
,
.
-
ret_from_kernel_thread
.
size
ret_from_kernel_thread
,
.
-
ret_from_kernel_thread
...
@@ -544,15 +544,6 @@ _ugdb_handle_exception:
...
@@ -544,15 +544,6 @@ _ugdb_handle_exception:
ba
do_sigtrap
; SIGTRAP the offending process.
ba
do_sigtrap
; SIGTRAP the offending process.
move.d
[
$sp
+],
$r0
; Restore R0 in delay slot.
move.d
[
$sp
+],
$r0
; Restore R0 in delay slot.
.
global
kernel_execve
.
type
kernel_execve
,
@
function
kernel_execve
:
move.d
__NR_execve
,
$r9
break
13
ret
nop
.
size
kernel_execve
,
.
-
kernel_execve
.
data
.
data
.
section
.
rodata
,
"a"
.
section
.
rodata
,
"a"
...
...
arch/cris/arch-v32/kernel/process.c
View file @
1703a219
...
@@ -186,28 +186,6 @@ sys_vfork(void)
...
@@ -186,28 +186,6 @@ sys_vfork(void)
return
do_fork
(
CLONE_VFORK
|
CLONE_VM
|
SIGCHLD
,
rdusp
(),
current_pt_regs
(),
0
,
NULL
,
NULL
);
return
do_fork
(
CLONE_VFORK
|
CLONE_VM
|
SIGCHLD
,
rdusp
(),
current_pt_regs
(),
0
,
NULL
,
NULL
);
}
}
/* sys_execve() executes a new program. */
asmlinkage
int
sys_execve
(
const
char
*
fname
,
const
char
*
const
*
argv
,
const
char
*
const
*
envp
,
long
r13
,
long
mof
,
long
srp
,
struct
pt_regs
*
regs
)
{
int
error
;
struct
filename
*
filename
;
filename
=
getname
(
fname
);
error
=
PTR_ERR
(
filename
);
if
(
IS_ERR
(
filename
))
goto
out
;
error
=
do_execve
(
filename
->
name
,
argv
,
envp
,
regs
);
putname
(
filename
);
out:
return
error
;
}
unsigned
long
unsigned
long
get_wchan
(
struct
task_struct
*
p
)
get_wchan
(
struct
task_struct
*
p
)
{
{
...
...
arch/cris/include/asm/unistd.h
View file @
1703a219
...
@@ -371,6 +371,7 @@
...
@@ -371,6 +371,7 @@
#define __ARCH_WANT_SYS_SIGPROCMASK
#define __ARCH_WANT_SYS_SIGPROCMASK
#define __ARCH_WANT_SYS_RT_SIGACTION
#define __ARCH_WANT_SYS_RT_SIGACTION
#define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_RT_SIGSUSPEND
#define __ARCH_WANT_SYS_EXECVE
/*
/*
* "Conditional" syscalls
* "Conditional" syscalls
...
...
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