summaryrefslogtreecommitdiffstats
path: root/sys/vm
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
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')
-rw-r--r--sys/vm/pmap.h2
-rw-r--r--sys/vm/vm_extern.h2
-rw-r--r--sys/vm/vm_glue.c31
3 files changed, 33 insertions, 2 deletions
diff --git a/sys/vm/pmap.h b/sys/vm/pmap.h
index 1a1e232..36ca187 100644
--- a/sys/vm/pmap.h
+++ b/sys/vm/pmap.h
@@ -131,8 +131,6 @@ void pmap_prefault(pmap_t, vm_offset_t, vm_map_entry_t);
int pmap_mincore(pmap_t pmap, vm_offset_t addr);
void pmap_new_thread(struct thread *td, int pages);
void pmap_dispose_thread(struct thread *td);
-void pmap_new_altkstack(struct thread *td, int pages);
-void pmap_dispose_altkstack(struct thread *td);
void pmap_swapout_thread(struct thread *td);
void pmap_swapin_thread(struct thread *td);
void pmap_activate(struct thread *td);
diff --git a/sys/vm/vm_extern.h b/sys/vm/vm_extern.h
index eafc300..4718eff 100644
--- a/sys/vm/vm_extern.h
+++ b/sys/vm/vm_extern.h
@@ -96,5 +96,7 @@ void vm_object_print(/* db_expr_t */ long, boolean_t, /* db_expr_t */ long,
int vm_fault_quick(caddr_t v, int prot);
void vm_proc_new(struct proc *p);
void vm_proc_dispose(struct proc *p);
+void vm_thread_new_altkstack(struct thread *td, int pages);
+void vm_thread_dispose_altkstack(struct thread *td);
#endif /* _KERNEL */
#endif /* !_VM_EXTERN_H_ */
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