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
61b7fbc3
Commit
61b7fbc3
authored
Sep 22, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mn10300: convert to generic kernel_thread()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
6e754210
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
36 deletions
+19
-36
arch/mn10300/Kconfig
arch/mn10300/Kconfig
+1
-0
arch/mn10300/include/asm/processor.h
arch/mn10300/include/asm/processor.h
+0
-5
arch/mn10300/kernel/process.c
arch/mn10300/kernel/process.c
+18
-31
No files found.
arch/mn10300/Kconfig
View file @
61b7fbc3
...
...
@@ -8,6 +8,7 @@ config MN10300
select HAVE_ARCH_KGDB
select HAVE_NMI_WATCHDOG if MN10300_WD_TIMER
select GENERIC_CLOCKEVENTS
select GENERIC_KERNEL_THREAD
config AM33_2
def_bool n
...
...
arch/mn10300/include/asm/processor.h
View file @
61b7fbc3
...
...
@@ -132,11 +132,6 @@ static inline void start_thread(struct pt_regs *regs,
/* Free all resources held by a thread. */
extern
void
release_thread
(
struct
task_struct
*
);
/*
* create a kernel thread without removing it from tasklists
*/
extern
int
kernel_thread
(
int
(
*
fn
)(
void
*
),
void
*
arg
,
unsigned
long
flags
);
/*
* Return saved PC of a blocked thread.
*/
...
...
arch/mn10300/kernel/process.c
View file @
61b7fbc3
...
...
@@ -161,24 +161,6 @@ void show_regs(struct pt_regs *regs)
{
}
/*
* create a kernel thread
*/
int
kernel_thread
(
int
(
*
fn
)(
void
*
),
void
*
arg
,
unsigned
long
flags
)
{
struct
pt_regs
regs
=
{
.
a0
=
(
unsigned
long
)
fn
;
.
d0
=
(
unsigned
long
)
arg
;
};
local_save_flags
(
regs
.
epsw
);
regs
.
epsw
|=
EPSW_IE
|
EPSW_IM_7
;
/* Ok, create the new process.. */
return
do_fork
(
flags
|
CLONE_VM
|
CLONE_UNTRACED
,
0
,
&
regs
,
0
,
NULL
,
NULL
);
}
/*
* free current thread data structures etc..
*/
...
...
@@ -232,29 +214,34 @@ int copy_thread(unsigned long clone_flags,
/* allocate the userspace exception frame and set it up */
c_ksp
-=
sizeof
(
struct
pt_regs
);
c_regs
=
(
struct
pt_regs
*
)
c_ksp
;
c_ksp
-=
12
;
/* allocate function call ABI slack */
/* set up things up so the scheduler can start the new task */
p
->
thread
.
uregs
=
c_regs
;
ti
->
frame
=
c_regs
;
p
->
thread
.
a3
=
(
unsigned
long
)
c_regs
;
p
->
thread
.
sp
=
c_ksp
;
p
->
thread
.
wchan
=
p
->
thread
.
pc
;
p
->
thread
.
usp
=
c_usp
;
if
(
unlikely
(
!
kregs
))
{
memset
(
c_regs
,
0
,
sizeof
(
struct
pt_regs
));
c_regs
->
a0
=
c_usp
;
/* function */
c_regs
->
d0
=
ustk_size
;
/* argument */
local_save_flags
(
c_regs
->
epsw
);
c_regs
->
epsw
|=
EPSW_IE
|
EPSW_IM_7
;
p
->
thread
.
pc
=
(
unsigned
long
)
ret_from_kernel_thread
;
return
0
;
}
*
c_regs
=
*
kregs
;
c_regs
->
sp
=
c_usp
;
c_regs
->
epsw
&=
~
EPSW_FE
;
/* my FPU */
c_ksp
-=
12
;
/* allocate function call ABI slack */
/* the new TLS pointer is passed in as arg #5 to sys_clone() */
if
(
clone_flags
&
CLONE_SETTLS
)
c_regs
->
e2
=
current_frame
()
->
d3
;
if
(
unlikely
(
!
user_mode
(
kregs
)))
p
->
thread
.
pc
=
(
unsigned
long
)
ret_from_kernel_thread
;
else
p
->
thread
.
pc
=
(
unsigned
long
)
ret_from_fork
;
/* set up things up so the scheduler can start the new task */
ti
->
frame
=
c_regs
;
p
->
thread
.
a3
=
(
unsigned
long
)
c_regs
;
p
->
thread
.
sp
=
c_ksp
;
p
->
thread
.
wchan
=
p
->
thread
.
pc
;
p
->
thread
.
usp
=
c_usp
;
p
->
thread
.
pc
=
(
unsigned
long
)
ret_from_fork
;
return
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