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
bfb8d126
Commit
bfb8d126
authored
Nov 21, 2002
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SPARC]: Update for new do_fork semantics.
parent
7898b321
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
22 deletions
+22
-22
arch/sparc/kernel/process.c
arch/sparc/kernel/process.c
+10
-16
arch/sparc64/kernel/process.c
arch/sparc64/kernel/process.c
+12
-6
No files found.
arch/sparc/kernel/process.c
View file @
bfb8d126
...
...
@@ -457,16 +457,20 @@ asmlinkage int sparc_do_fork(unsigned long clone_flags,
struct
pt_regs
*
regs
,
unsigned
long
stack_size
)
{
unsigned
long
tid_ptr
=
0
;
unsigned
long
parent_tid_ptr
=
0
;
unsigned
long
child_tid_ptr
=
0
;
struct
task_struct
*
p
;
clone_flags
&=
~
CLONE_IDLETASK
;
if
(
clone_flags
&
(
CLONE_SETTID
|
CLONE_CLEARTID
))
tid_ptr
=
regs
->
u_regs
[
UREG_G2
];
if
(
clone_flags
&
(
CLONE_SETTID
|
CLONE_CLEARTID
))
{
parent_tid_ptr
=
regs
->
u_regs
[
UREG_G2
];
child_tid_ptr
=
regs
->
u_regs
[
UREG_G3
];
}
p
=
do_fork
(
clone_flags
,
stack_start
,
regs
,
stack_size
,
(
int
*
)
tid_ptr
);
regs
,
stack_size
,
(
int
*
)
parent_tid_ptr
,
(
int
*
)
child_tid_ptr
);
return
IS_ERR
(
p
)
?
PTR_ERR
(
p
)
:
p
->
pid
;
}
...
...
@@ -507,7 +511,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
#endif
}
p
->
user
_tid
=
NULL
;
p
->
set_child_tid
=
p
->
clear_child
_tid
=
NULL
;
/* Calculate offset to stack_frame & pt_regs */
stack_offset
=
THREAD_SIZE
-
TRACEREG_SZ
;
...
...
@@ -582,16 +586,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
/* Set the return value for the parent. */
regs
->
u_regs
[
UREG_I1
]
=
0
;
if
(
!
(
clone_flags
&
(
CLONE_SETTID
|
CLONE_CLEARTID
)))
return
0
;
if
(
clone_flags
&
CLONE_SETTID
)
if
(
put_user
(
p
->
pid
,
(
int
*
)
childregs
->
u_regs
[
UREG_G2
]))
return
-
EFAULT
;
if
(
clone_flags
&
CLONE_CLEARTID
)
p
->
user_tid
=
(
int
*
)
childregs
->
u_regs
[
UREG_G2
];
return
0
;
}
...
...
arch/sparc64/kernel/process.c
View file @
bfb8d126
...
...
@@ -568,18 +568,24 @@ asmlinkage int sparc_do_fork(unsigned long clone_flags,
unsigned
long
stack_size
)
{
struct
task_struct
*
p
;
unsigned
long
tid_ptr
=
0
;
unsigned
long
parent_tid_ptr
=
0
;
unsigned
long
child_tid_ptr
=
0
;
clone_flags
&=
~
CLONE_IDLETASK
;
if
(
clone_flags
&
(
CLONE_SETTID
|
CLONE_CLEARTID
))
{
tid_ptr
=
regs
->
u_regs
[
UREG_G2
];
if
(
test_thread_flag
(
TIF_32BIT
))
tid_ptr
&=
0xffffffff
;
parent_tid_ptr
=
regs
->
u_regs
[
UREG_G2
];
child_tid_ptr
=
regs
->
u_regs
[
UREG_G3
];
if
(
test_thread_flag
(
TIF_32BIT
))
{
parent_tid_ptr
&=
0xffffffff
;
child_tid_ptr
&=
0xffffffff
;
}
}
p
=
do_fork
(
clone_flags
,
stack_start
,
regs
,
stack_size
,
(
int
*
)
tid_ptr
);
regs
,
stack_size
,
(
int
*
)
parent_tid_ptr
,
(
int
*
)
child_tid_ptr
);
return
IS_ERR
(
p
)
?
PTR_ERR
(
p
)
:
p
->
pid
;
}
...
...
@@ -601,7 +607,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
p
->
thread
.
smp_lock_pc
=
0
;
#endif
p
->
user
_tid
=
NULL
;
p
->
set_child_tid
=
p
->
clear_child
_tid
=
NULL
;
/* Calculate offset to stack_frame & pt_regs */
child_trap_frame
=
((
char
*
)
t
)
+
(
THREAD_SIZE
-
(
TRACEREG_SZ
+
REGWIN_SZ
));
...
...
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