aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Chagin <dchagin@FreeBSD.org>2011-02-12 16:33:00 +0000
committerDmitry Chagin <dchagin@FreeBSD.org>2011-02-12 16:33:00 +0000
commitc8d6845e9e6420e8d876bd3156e3870789f6c1a6 (patch)
tree88f0502103d23e3269c330df10641d365694ceff
parent2c7660ba3e67c64161b4c77b403534028f0faf6f (diff)
downloadsrc-c8d6845e9e6420e8d876bd3156e3870789f6c1a6.tar.gz
src-c8d6845e9e6420e8d876bd3156e3870789f6c1a6.zip
In preparation for moving linux_clone() to a MI path
introduce linux_set_upcall_kse().
Notes
Notes: svn path=/head/; revision=218613
-rw-r--r--sys/amd64/linux32/linux.h2
-rw-r--r--sys/amd64/linux32/linux32_machdep.c11
-rw-r--r--sys/i386/linux/linux.h2
-rw-r--r--sys/i386/linux/linux_machdep.c11
4 files changed, 24 insertions, 2 deletions
diff --git a/sys/amd64/linux32/linux.h b/sys/amd64/linux32/linux.h
index 39d4a80554ef..17eded4245f7 100644
--- a/sys/amd64/linux32/linux.h
+++ b/sys/amd64/linux32/linux.h
@@ -920,4 +920,6 @@ struct linux_robust_list_head {
l_uintptr_t pending_list;
};
+int linux_set_upcall_kse(struct thread *td, register_t stack);
+
#endif /* !_AMD64_LINUX_H_ */
diff --git a/sys/amd64/linux32/linux32_machdep.c b/sys/amd64/linux32/linux32_machdep.c
index d24b7b6e3ea6..ac205b04447d 100644
--- a/sys/amd64/linux32/linux32_machdep.c
+++ b/sys/amd64/linux32/linux32_machdep.c
@@ -655,7 +655,7 @@ linux_clone(struct thread *td, struct linux_clone_args *args)
* intact.
*/
if (args->stack)
- td2->td_frame->tf_rsp = PTROUT(args->stack);
+ linux_set_upcall_kse(td2, PTROUT(args->stack));
if (args->flags & LINUX_CLONE_SETTLS)
linux_set_cloned_tls(td2, args->tls);
@@ -694,6 +694,15 @@ linux_clone(struct thread *td, struct linux_clone_args *args)
return (0);
}
+int
+linux_set_upcall_kse(struct thread *td, register_t stack)
+{
+
+ td->td_frame->tf_rsp = stack;
+
+ return (0);
+}
+
#define STACK_SIZE (2 * 1024 * 1024)
#define GUARD_SIZE (4 * PAGE_SIZE)
diff --git a/sys/i386/linux/linux.h b/sys/i386/linux/linux.h
index fe84c063ba99..b9e3f270f975 100644
--- a/sys/i386/linux/linux.h
+++ b/sys/i386/linux/linux.h
@@ -880,4 +880,6 @@ struct linux_robust_list_head {
struct linux_robust_list *pending_list;
};
+int linux_set_upcall_kse(struct thread *td, register_t stack);
+
#endif /* !_I386_LINUX_H_ */
diff --git a/sys/i386/linux/linux_machdep.c b/sys/i386/linux/linux_machdep.c
index b8e18eff1947..6af39d216aec 100644
--- a/sys/i386/linux/linux_machdep.c
+++ b/sys/i386/linux/linux_machdep.c
@@ -559,7 +559,7 @@ linux_clone(struct thread *td, struct linux_clone_args *args)
* this is what normal fork() does so we just keep the tf_esp arg intact
*/
if (args->stack)
- td2->td_frame->tf_esp = (unsigned int)args->stack;
+ linux_set_upcall_kse(td2, PTROUT(args->stack));
if (args->flags & LINUX_CLONE_SETTLS)
linux_set_cloned_tls(td2, args->tls);
@@ -597,6 +597,15 @@ linux_clone(struct thread *td, struct linux_clone_args *args)
return (0);
}
+int
+linux_set_upcall_kse(struct thread *td, register_t stack)
+{
+
+ td->td_frame->tf_esp = stack;
+
+ return (0);
+}
+
#define STACK_SIZE (2 * 1024 * 1024)
#define GUARD_SIZE (4 * PAGE_SIZE)