summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_glue.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-06-14 06:20:25 +0000
committeralc <alc@FreeBSD.org>2003-06-14 06:20:25 +0000
commitd20c30720bd75946190688b47500e9780baef631 (patch)
treedd61e4c6e73f5c138ec859061b2bcca151d658da /sys/vm/vm_glue.c
parenta80cfe492357d8c190a91f25d7c62688b38e5c4a (diff)
downloadFreeBSD-src-d20c30720bd75946190688b47500e9780baef631.zip
FreeBSD-src-d20c30720bd75946190688b47500e9780baef631.tar.gz
Move the *_new_altkstack() and *_dispose_altkstack() functions out of the
various pmap implementations into the machine-independent vm. They were all identical.
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 ec15d96..2145c0c 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
OpenPOWER on IntegriCloud