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
49ed3398
Commit
49ed3398
authored
Sep 22, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
frv: switch to generic kernel_thread()
parent
019f96a3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
23 deletions
+20
-23
arch/frv/Kconfig
arch/frv/Kconfig
+1
-0
arch/frv/include/asm/processor.h
arch/frv/include/asm/processor.h
+0
-1
arch/frv/kernel/process.c
arch/frv/kernel/process.c
+19
-22
No files found.
arch/frv/Kconfig
View file @
49ed3398
...
...
@@ -10,6 +10,7 @@ config FRV
select ARCH_HAVE_NMI_SAFE_CMPXCHG
select GENERIC_CPU_DEVICES
select ARCH_WANT_IPC_PARSE_VERSION
select GENERIC_KERNEL_THREAD
config ZONE_DMA
bool
...
...
arch/frv/include/asm/processor.h
View file @
49ed3398
...
...
@@ -105,7 +105,6 @@ static inline void release_thread(struct task_struct *dead_task)
{
}
extern
asmlinkage
int
kernel_thread
(
int
(
*
fn
)(
void
*
),
void
*
arg
,
unsigned
long
flags
);
extern
asmlinkage
void
save_user_regs
(
struct
user_context
*
target
);
extern
asmlinkage
void
*
restore_user_regs
(
const
struct
user_context
*
target
,
...);
...
...
arch/frv/kernel/process.c
View file @
49ed3398
...
...
@@ -170,7 +170,7 @@ asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
* set up the kernel stack and exception frames for a new process
*/
int
copy_thread
(
unsigned
long
clone_flags
,
unsigned
long
usp
,
unsigned
long
topstk
,
unsigned
long
usp
,
unsigned
long
arg
,
struct
task_struct
*
p
,
struct
pt_regs
*
regs
)
{
struct
pt_regs
*
childregs
;
...
...
@@ -178,17 +178,6 @@ int copy_thread(unsigned long clone_flags,
childregs
=
(
struct
pt_regs
*
)
(
task_stack_page
(
p
)
+
THREAD_SIZE
-
FRV_FRAME0_SIZE
);
/* set up the userspace frame (the only place that the USP is stored) */
*
childregs
=
*
regs
;
childregs
->
sp
=
usp
;
childregs
->
next_frame
=
NULL
;
if
(
unlikely
(
!
user_mode
(
regs
)))
p
->
thread
.
pc
=
(
unsigned
long
)
ret_from_kernel_thread
;
else
p
->
thread
.
pc
=
(
unsigned
long
)
ret_from_fork
;
p
->
set_child_tid
=
p
->
clear_child_tid
=
NULL
;
p
->
thread
.
frame
=
childregs
;
...
...
@@ -198,6 +187,24 @@ int copy_thread(unsigned long clone_flags,
p
->
thread
.
lr
=
0
;
p
->
thread
.
frame0
=
childregs
;
if
(
unlikely
(
!
regs
))
{
memset
(
childregs
,
0
,
sizeof
(
struct
pt_regs
));
childregs
->
gr9
=
usp
;
/* function */
childregs
->
gr8
=
arg
;
chilregs
->
psr
=
PSR_S
;
p
->
thread
.
pc
=
(
unsigned
long
)
ret_from_kernel_thread
;
save_user_regs
(
p
->
thread
.
user
);
return
0
;
}
/* set up the userspace frame (the only place that the USP is stored) */
*
childregs
=
*
regs
;
childregs
->
sp
=
usp
;
childregs
->
next_frame
=
NULL
;
p
->
thread
.
pc
=
(
unsigned
long
)
ret_from_fork
;
/* the new TLS pointer is passed in as arg #5 to sys_clone() */
if
(
clone_flags
&
CLONE_SETTLS
)
childregs
->
gr29
=
childregs
->
gr12
;
...
...
@@ -320,13 +327,3 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpregs)
sizeof
(
current
->
thread
.
user
->
f
));
return
1
;
}
int
kernel_thread
(
int
(
*
fn
)(
void
*
),
void
*
arg
,
unsigned
long
flags
)
{
struct
pt_regs
regs
=
{
.
gr8
=
(
unsigned
long
)
arg
;
.
gr9
=
(
unsigned
long
)
fn
;
.
psr
=
PSR_S
;
};
return
do_fork
(
flags
|
CLONE_VM
|
CLONE_UNTRACED
,
0
,
&
regs
,
0
,
NULL
,
NULL
);
}
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