diff options
author | marcel <marcel@FreeBSD.org> | 2007-11-14 20:21:54 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2007-11-14 20:21:54 +0000 |
commit | 1e7c4f0a3f35313c194b0b0704fb21ab49c0d88e (patch) | |
tree | e09b10892aff720f030e45a1b3c6850510e18f75 /sys | |
parent | 5a31a4a6d6dcd79ba50f5763054555c7fe59bfc1 (diff) | |
download | FreeBSD-src-1e7c4f0a3f35313c194b0b0704fb21ab49c0d88e.zip FreeBSD-src-1e7c4f0a3f35313c194b0b0704fb21ab49c0d88e.tar.gz |
o Rename cpu_thread_setup() to cpu_thread_alloc() to better
communicate that it relates to (is called by) thread_alloc()
o Add cpu_thread_free() which is called from thread_free()
to counter-act cpu_thread_alloc().
i386: Have cpu_thread_free() call cpu_thread_clean() to
preserve behaviour.
ia64: Have cpu_thread_free() call mtx_destroy() for the
mutex initialized in cpu_thread_alloc().
PR: ia64/118024
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/amd64/vm_machdep.c | 7 | ||||
-rw-r--r-- | sys/arm/arm/vm_machdep.c | 9 | ||||
-rw-r--r-- | sys/i386/i386/vm_machdep.c | 9 | ||||
-rw-r--r-- | sys/ia64/ia64/machdep.c | 2 | ||||
-rw-r--r-- | sys/ia64/ia64/vm_machdep.c | 9 | ||||
-rw-r--r-- | sys/kern/kern_thread.c | 4 | ||||
-rw-r--r-- | sys/powerpc/aim/vm_machdep.c | 7 | ||||
-rw-r--r-- | sys/powerpc/powerpc/vm_machdep.c | 7 | ||||
-rw-r--r-- | sys/sparc64/sparc64/vm_machdep.c | 7 | ||||
-rw-r--r-- | sys/sun4v/sun4v/vm_machdep.c | 7 | ||||
-rw-r--r-- | sys/sys/proc.h | 3 |
11 files changed, 58 insertions, 13 deletions
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index c3c5283..aba0fad 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -240,7 +240,7 @@ cpu_thread_swapout(struct thread *td) } void -cpu_thread_setup(struct thread *td) +cpu_thread_alloc(struct thread *td) { td->td_pcb = (struct pcb *)(td->td_kstack + @@ -248,6 +248,11 @@ cpu_thread_setup(struct thread *td) td->td_frame = (struct trapframe *)td->td_pcb - 1; } +void +cpu_thread_free(struct thread *td) +{ +} + /* * Initialize machine state (pcb and trap frame) for a new thread about to * upcall. Put enough state in the new thread's PCB to get it to go back diff --git a/sys/arm/arm/vm_machdep.c b/sys/arm/arm/vm_machdep.c index 2e87030..675927c 100644 --- a/sys/arm/arm/vm_machdep.c +++ b/sys/arm/arm/vm_machdep.c @@ -333,7 +333,7 @@ cpu_thread_exit(struct thread *td) } void -cpu_thread_setup(struct thread *td) +cpu_thread_alloc(struct thread *td) { td->td_pcb = (struct pcb *)(td->td_kstack + td->td_kstack_pages * PAGE_SIZE) - 1; @@ -344,8 +344,13 @@ cpu_thread_setup(struct thread *td) pmap_use_minicache(td->td_kstack, td->td_kstack_pages * PAGE_SIZE); #endif #endif - } + +void +cpu_thread_free(struct thread *td) +{ +} + void cpu_thread_clean(struct thread *td) { diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index bbcdddf..346d423 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -361,7 +361,7 @@ cpu_thread_swapout(struct thread *td) } void -cpu_thread_setup(struct thread *td) +cpu_thread_alloc(struct thread *td) { td->td_pcb = (struct pcb *)(td->td_kstack + @@ -370,6 +370,13 @@ cpu_thread_setup(struct thread *td) td->td_pcb->pcb_ext = NULL; } +void +cpu_thread_free(struct thread *td) +{ + + cpu_thread_clean(td); +} + /* * Initialize machine state (pcb and trap frame) for a new thread about to * upcall. Put enough state in the new thread's PCB to get it to go back diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index b0854fc..3c44b2e 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -806,7 +806,7 @@ ia64_init(void) * and make proc0's trapframe pointer point to it for sanity. * Initialise proc0's backing store to start after u area. */ - cpu_thread_setup(&thread0); + cpu_thread_alloc(&thread0); thread0.td_frame->tf_flags = FRAME_SYSCALL; thread0.td_pcb->pcb_special.sp = (u_int64_t)thread0.td_frame - 16; diff --git a/sys/ia64/ia64/vm_machdep.c b/sys/ia64/ia64/vm_machdep.c index 40708c4..42a1796 100644 --- a/sys/ia64/ia64/vm_machdep.c +++ b/sys/ia64/ia64/vm_machdep.c @@ -107,7 +107,7 @@ cpu_thread_clean(struct thread *td) } void -cpu_thread_setup(struct thread *td) +cpu_thread_alloc(struct thread *td) { intptr_t sp; @@ -121,6 +121,13 @@ cpu_thread_setup(struct thread *td) } void +cpu_thread_free(struct thread *td) +{ + + mtx_destroy(&td->td_md.md_highfp_mtx); +} + +void cpu_thread_swapin(struct thread *td) { } diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index e1a27a5..7fdfa20 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -325,7 +325,7 @@ thread_alloc(void) uma_zfree(thread_zone, td); return (NULL); } - cpu_thread_setup(td); + cpu_thread_alloc(td); return (td); } @@ -337,7 +337,7 @@ void thread_free(struct thread *td) { - cpu_thread_clean(td); + cpu_thread_free(td); if (td->td_altkstack != 0) vm_thread_dispose_altkstack(td); if (td->td_kstack != 0) diff --git a/sys/powerpc/aim/vm_machdep.c b/sys/powerpc/aim/vm_machdep.c index 1492a07..ce8416a 100644 --- a/sys/powerpc/aim/vm_machdep.c +++ b/sys/powerpc/aim/vm_machdep.c @@ -277,7 +277,7 @@ cpu_thread_clean(struct thread *td) } void -cpu_thread_setup(struct thread *td) +cpu_thread_alloc(struct thread *td) { struct pcb *pcb; @@ -288,6 +288,11 @@ cpu_thread_setup(struct thread *td) } void +cpu_thread_free(struct thread *td) +{ +} + +void cpu_thread_swapin(struct thread *td) { } diff --git a/sys/powerpc/powerpc/vm_machdep.c b/sys/powerpc/powerpc/vm_machdep.c index 1492a07..ce8416a 100644 --- a/sys/powerpc/powerpc/vm_machdep.c +++ b/sys/powerpc/powerpc/vm_machdep.c @@ -277,7 +277,7 @@ cpu_thread_clean(struct thread *td) } void -cpu_thread_setup(struct thread *td) +cpu_thread_alloc(struct thread *td) { struct pcb *pcb; @@ -288,6 +288,11 @@ cpu_thread_setup(struct thread *td) } void +cpu_thread_free(struct thread *td) +{ +} + +void cpu_thread_swapin(struct thread *td) { } diff --git a/sys/sparc64/sparc64/vm_machdep.c b/sys/sparc64/sparc64/vm_machdep.c index fce7786..2f4c0ea 100644 --- a/sys/sparc64/sparc64/vm_machdep.c +++ b/sys/sparc64/sparc64/vm_machdep.c @@ -132,7 +132,7 @@ cpu_thread_clean(struct thread *td) } void -cpu_thread_setup(struct thread *td) +cpu_thread_alloc(struct thread *td) { struct pcb *pcb; @@ -144,6 +144,11 @@ cpu_thread_setup(struct thread *td) } void +cpu_thread_free(struct thread *td) +{ +} + +void cpu_thread_swapin(struct thread *td) { } diff --git a/sys/sun4v/sun4v/vm_machdep.c b/sys/sun4v/sun4v/vm_machdep.c index fbfa4a0..63a002f 100644 --- a/sys/sun4v/sun4v/vm_machdep.c +++ b/sys/sun4v/sun4v/vm_machdep.c @@ -111,7 +111,7 @@ cpu_thread_clean(struct thread *td) } void -cpu_thread_setup(struct thread *td) +cpu_thread_alloc(struct thread *td) { struct pcb *pcb; @@ -127,6 +127,11 @@ cpu_thread_setup(struct thread *td) } void +cpu_thread_free(struct thread *td) +{ +} + +void cpu_thread_swapin(struct thread *td) { } diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 8e0b90e..eaf6f03 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -877,9 +877,10 @@ void upcall_remove(struct thread *td); void cpu_set_upcall(struct thread *td, struct thread *td0); void cpu_set_upcall_kse(struct thread *, void (*)(void *), void *, stack_t *); int cpu_set_user_tls(struct thread *, void *tls_base); +void cpu_thread_alloc(struct thread *); void cpu_thread_clean(struct thread *); void cpu_thread_exit(struct thread *); -void cpu_thread_setup(struct thread *td); +void cpu_thread_free(struct thread *); void cpu_thread_swapin(struct thread *); void cpu_thread_swapout(struct thread *); struct thread *thread_alloc(void); |