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
7143727d
Commit
7143727d
authored
Dec 06, 2002
by
Martin Schwidefsky
Committed by
Linus Torvalds
Dec 06, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] s390: do_fork parameters.
Add additional parameter for do_fork.
parent
bf808137
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
14 deletions
+20
-14
arch/s390/kernel/process.c
arch/s390/kernel/process.c
+9
-6
arch/s390/kernel/smp.c
arch/s390/kernel/smp.c
+1
-1
arch/s390x/kernel/process.c
arch/s390x/kernel/process.c
+9
-6
arch/s390x/kernel/smp.c
arch/s390x/kernel/smp.c
+1
-1
No files found.
arch/s390/kernel/process.c
View file @
7143727d
...
@@ -146,7 +146,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
...
@@ -146,7 +146,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
regs
.
orig_gpr2
=
-
1
;
regs
.
orig_gpr2
=
-
1
;
/* Ok, create the new process.. */
/* Ok, create the new process.. */
p
=
do_fork
(
flags
|
CLONE_VM
|
CLONE_UNTRACED
,
0
,
&
regs
,
0
,
NULL
);
p
=
do_fork
(
flags
|
CLONE_VM
|
CLONE_UNTRACED
,
0
,
&
regs
,
0
,
NULL
,
NULL
);
return
IS_ERR
(
p
)
?
PTR_ERR
(
p
)
:
p
->
pid
;
return
IS_ERR
(
p
)
?
PTR_ERR
(
p
)
:
p
->
pid
;
}
}
...
@@ -188,6 +188,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp,
...
@@ -188,6 +188,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp,
frame
=
((
struct
stack_frame
*
)
frame
=
((
struct
stack_frame
*
)
(
THREAD_SIZE
+
(
unsigned
long
)
p
->
thread_info
))
-
1
;
(
THREAD_SIZE
+
(
unsigned
long
)
p
->
thread_info
))
-
1
;
p
->
thread
.
ksp
=
(
unsigned
long
)
frame
;
p
->
thread
.
ksp
=
(
unsigned
long
)
frame
;
p
->
set_child_tid
=
p
->
clear_child_tid
=
NULL
;
frame
->
childregs
=
*
regs
;
frame
->
childregs
=
*
regs
;
frame
->
childregs
.
gprs
[
2
]
=
0
;
/* child returns 0 on fork. */
frame
->
childregs
.
gprs
[
2
]
=
0
;
/* child returns 0 on fork. */
frame
->
childregs
.
gprs
[
15
]
=
new_stackp
;
frame
->
childregs
.
gprs
[
15
]
=
new_stackp
;
...
@@ -218,7 +219,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp,
...
@@ -218,7 +219,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp,
asmlinkage
int
sys_fork
(
struct
pt_regs
regs
)
asmlinkage
int
sys_fork
(
struct
pt_regs
regs
)
{
{
struct
task_struct
*
p
;
struct
task_struct
*
p
;
p
=
do_fork
(
SIGCHLD
,
regs
.
gprs
[
15
],
&
regs
,
0
,
NULL
);
p
=
do_fork
(
SIGCHLD
,
regs
.
gprs
[
15
],
&
regs
,
0
,
NULL
,
NULL
);
return
IS_ERR
(
p
)
?
PTR_ERR
(
p
)
:
p
->
pid
;
return
IS_ERR
(
p
)
?
PTR_ERR
(
p
)
:
p
->
pid
;
}
}
...
@@ -227,14 +228,16 @@ asmlinkage int sys_clone(struct pt_regs regs)
...
@@ -227,14 +228,16 @@ asmlinkage int sys_clone(struct pt_regs regs)
unsigned
long
clone_flags
;
unsigned
long
clone_flags
;
unsigned
long
newsp
;
unsigned
long
newsp
;
struct
task_struct
*
p
;
struct
task_struct
*
p
;
int
*
user_tid
;
int
*
parent_tidptr
,
*
child_tidptr
;
clone_flags
=
regs
.
gprs
[
3
];
clone_flags
=
regs
.
gprs
[
3
];
newsp
=
regs
.
orig_gpr2
;
newsp
=
regs
.
orig_gpr2
;
user_tid
=
(
int
*
)
regs
.
gprs
[
4
];
parent_tidptr
=
(
int
*
)
regs
.
gprs
[
4
];
child_tidptr
=
(
int
*
)
regs
.
gprs
[
5
];
if
(
!
newsp
)
if
(
!
newsp
)
newsp
=
regs
.
gprs
[
15
];
newsp
=
regs
.
gprs
[
15
];
p
=
do_fork
(
clone_flags
&
~
CLONE_IDLETASK
,
newsp
,
&
regs
,
0
,
user_tid
);
p
=
do_fork
(
clone_flags
&
~
CLONE_IDLETASK
,
newsp
,
&
regs
,
0
,
parent_tidptr
,
child_tidptr
);
return
IS_ERR
(
p
)
?
PTR_ERR
(
p
)
:
p
->
pid
;
return
IS_ERR
(
p
)
?
PTR_ERR
(
p
)
:
p
->
pid
;
}
}
...
@@ -252,7 +255,7 @@ asmlinkage int sys_vfork(struct pt_regs regs)
...
@@ -252,7 +255,7 @@ asmlinkage int sys_vfork(struct pt_regs regs)
{
{
struct
task_struct
*
p
;
struct
task_struct
*
p
;
p
=
do_fork
(
CLONE_VFORK
|
CLONE_VM
|
SIGCHLD
,
p
=
do_fork
(
CLONE_VFORK
|
CLONE_VM
|
SIGCHLD
,
regs
.
gprs
[
15
],
&
regs
,
0
,
NULL
);
regs
.
gprs
[
15
],
&
regs
,
0
,
NULL
,
NULL
);
return
IS_ERR
(
p
)
?
PTR_ERR
(
p
)
:
p
->
pid
;
return
IS_ERR
(
p
)
?
PTR_ERR
(
p
)
:
p
->
pid
;
}
}
...
...
arch/s390/kernel/smp.c
View file @
7143727d
...
@@ -477,7 +477,7 @@ static struct task_struct *__devinit fork_by_hand(void)
...
@@ -477,7 +477,7 @@ static struct task_struct *__devinit fork_by_hand(void)
/* don't care about the psw and regs settings since we'll never
/* don't care about the psw and regs settings since we'll never
reschedule the forked task. */
reschedule the forked task. */
memset
(
&
regs
,
0
,
sizeof
(
struct
pt_regs
));
memset
(
&
regs
,
0
,
sizeof
(
struct
pt_regs
));
return
do_fork
(
CLONE_VM
|
CLONE_IDLETASK
,
0
,
&
regs
,
0
,
NULL
);
return
do_fork
(
CLONE_VM
|
CLONE_IDLETASK
,
0
,
&
regs
,
0
,
NULL
,
NULL
);
}
}
int
__cpu_up
(
unsigned
int
cpu
)
int
__cpu_up
(
unsigned
int
cpu
)
...
...
arch/s390x/kernel/process.c
View file @
7143727d
...
@@ -143,7 +143,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
...
@@ -143,7 +143,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
regs
.
orig_gpr2
=
-
1
;
regs
.
orig_gpr2
=
-
1
;
/* Ok, create the new process.. */
/* Ok, create the new process.. */
p
=
do_fork
(
flags
|
CLONE_VM
|
CLONE_UNTRACED
,
0
,
&
regs
,
0
,
NULL
);
p
=
do_fork
(
flags
|
CLONE_VM
|
CLONE_UNTRACED
,
0
,
&
regs
,
0
,
NULL
,
NULL
);
return
IS_ERR
(
p
)
?
PTR_ERR
(
p
)
:
p
->
pid
;
return
IS_ERR
(
p
)
?
PTR_ERR
(
p
)
:
p
->
pid
;
}
}
...
@@ -185,6 +185,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp,
...
@@ -185,6 +185,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp,
frame
=
((
struct
stack_frame
*
)
frame
=
((
struct
stack_frame
*
)
(
THREAD_SIZE
+
(
unsigned
long
)
p
->
thread_info
))
-
1
;
(
THREAD_SIZE
+
(
unsigned
long
)
p
->
thread_info
))
-
1
;
p
->
thread
.
ksp
=
(
unsigned
long
)
frame
;
p
->
thread
.
ksp
=
(
unsigned
long
)
frame
;
p
->
set_child_tid
=
p
->
clear_child_tid
=
NULL
;
frame
->
childregs
=
*
regs
;
frame
->
childregs
=
*
regs
;
frame
->
childregs
.
gprs
[
2
]
=
0
;
/* child returns 0 on fork. */
frame
->
childregs
.
gprs
[
2
]
=
0
;
/* child returns 0 on fork. */
frame
->
childregs
.
gprs
[
15
]
=
new_stackp
;
frame
->
childregs
.
gprs
[
15
]
=
new_stackp
;
...
@@ -208,7 +209,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp,
...
@@ -208,7 +209,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp,
asmlinkage
int
sys_fork
(
struct
pt_regs
regs
)
asmlinkage
int
sys_fork
(
struct
pt_regs
regs
)
{
{
struct
task_struct
*
p
;
struct
task_struct
*
p
;
p
=
do_fork
(
SIGCHLD
,
regs
.
gprs
[
15
],
&
regs
,
0
,
NULL
);
p
=
do_fork
(
SIGCHLD
,
regs
.
gprs
[
15
],
&
regs
,
0
,
NULL
,
NULL
);
return
IS_ERR
(
p
)
?
PTR_ERR
(
p
)
:
p
->
pid
;
return
IS_ERR
(
p
)
?
PTR_ERR
(
p
)
:
p
->
pid
;
}
}
...
@@ -217,14 +218,16 @@ asmlinkage int sys_clone(struct pt_regs regs)
...
@@ -217,14 +218,16 @@ asmlinkage int sys_clone(struct pt_regs regs)
unsigned
long
clone_flags
;
unsigned
long
clone_flags
;
unsigned
long
newsp
;
unsigned
long
newsp
;
struct
task_struct
*
p
;
struct
task_struct
*
p
;
int
*
user_tid
;
int
*
parent_tidptr
,
*
child_tidptr
;
clone_flags
=
regs
.
gprs
[
3
];
clone_flags
=
regs
.
gprs
[
3
];
newsp
=
regs
.
orig_gpr2
;
newsp
=
regs
.
orig_gpr2
;
user_tid
=
(
int
*
)
regs
.
gprs
[
4
];
parent_tidptr
=
(
int
*
)
regs
.
gprs
[
4
];
child_tidptr
=
(
int
*
)
regs
.
gprs
[
5
];
if
(
!
newsp
)
if
(
!
newsp
)
newsp
=
regs
.
gprs
[
15
];
newsp
=
regs
.
gprs
[
15
];
p
=
do_fork
(
clone_flags
&
~
CLONE_IDLETASK
,
newsp
,
&
regs
,
0
,
user_tid
);
p
=
do_fork
(
clone_flags
&
~
CLONE_IDLETASK
,
newsp
,
&
regs
,
0
,
parent_tidptr
,
child_tidptr
);
return
IS_ERR
(
p
)
?
PTR_ERR
(
p
)
:
p
->
pid
;
return
IS_ERR
(
p
)
?
PTR_ERR
(
p
)
:
p
->
pid
;
}
}
...
@@ -242,7 +245,7 @@ asmlinkage int sys_vfork(struct pt_regs regs)
...
@@ -242,7 +245,7 @@ asmlinkage int sys_vfork(struct pt_regs regs)
{
{
struct
task_struct
*
p
;
struct
task_struct
*
p
;
p
=
do_fork
(
CLONE_VFORK
|
CLONE_VM
|
SIGCHLD
,
p
=
do_fork
(
CLONE_VFORK
|
CLONE_VM
|
SIGCHLD
,
regs
.
gprs
[
15
],
&
regs
,
0
,
NULL
);
regs
.
gprs
[
15
],
&
regs
,
0
,
NULL
,
NULL
);
return
IS_ERR
(
p
)
?
PTR_ERR
(
p
)
:
p
->
pid
;
return
IS_ERR
(
p
)
?
PTR_ERR
(
p
)
:
p
->
pid
;
}
}
...
...
arch/s390x/kernel/smp.c
View file @
7143727d
...
@@ -461,7 +461,7 @@ static struct task_struct * __devinit fork_by_hand(void)
...
@@ -461,7 +461,7 @@ static struct task_struct * __devinit fork_by_hand(void)
/* don't care about the psw and regs settings since we'll never
/* don't care about the psw and regs settings since we'll never
reschedule the forked task. */
reschedule the forked task. */
memset
(
&
regs
,
0
,
sizeof
(
struct
pt_regs
));
memset
(
&
regs
,
0
,
sizeof
(
struct
pt_regs
));
return
do_fork
(
CLONE_VM
|
CLONE_IDLETASK
,
0
,
&
regs
,
0
,
NULL
);
return
do_fork
(
CLONE_VM
|
CLONE_IDLETASK
,
0
,
&
regs
,
0
,
NULL
,
NULL
);
}
}
int
__cpu_up
(
unsigned
int
cpu
)
int
__cpu_up
(
unsigned
int
cpu
)
...
...
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