summaryrefslogtreecommitdiff
path: root/sys/vm/vm_glue.c
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2003-06-14 06:20:25 +0000
committerAlan Cox <alc@FreeBSD.org>2003-06-14 06:20:25 +0000
commit89f4fca26524640a836b48761f0f131097bb43fe (patch)
treedd61e4c6e73f5c138ec859061b2bcca151d658da /sys/vm/vm_glue.c
parent5c784c8f4b7f19422d04565915b27ff9b1ffa07e (diff)
Notes
Diffstat (limited to 'sys/vm/vm_glue.c')
-rw-r--r--sys/vm/vm_glue.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c
index ec15d968cd08..2145c0c2f724 100644
--- a/sys/vm/vm_glue.c
+++ b/sys/vm/vm_glue.c
@@ -388,6 +388,37 @@ retry:
#endif
/*
+ * Set up a variable-sized alternate kstack.
+ */
+void
+vm_thread_new_altkstack(struct thread *td, int pages)
+{
+
+ td->td_altkstack = td->td_kstack;
+ td->td_altkstack_obj = td->td_kstack_obj;
+ td->td_altkstack_pages = td->td_kstack_pages;
+
+ pmap_new_thread(td, pages);
+}
+
+/*
+ * Restore the original kstack.
+ */
+void
+vm_thread_dispose_altkstack(struct thread *td)
+{
+
+ pmap_dispose_thread(td);
+
+ td->td_kstack = td->td_altkstack;
+ td->td_kstack_obj = td->td_altkstack_obj;
+ td->td_kstack_pages = td->td_altkstack_pages;
+ td->td_altkstack = 0;
+ td->td_altkstack_obj = NULL;
+ td->td_altkstack_pages = 0;
+}
+
+/*
* Implement fork's actions on an address space.
* Here we arrange for the address space to be copied or referenced,
* allocate a user struct (pcb and kernel stack), then call the