diff options
author | marcel <marcel@FreeBSD.org> | 2003-08-16 23:15:15 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-08-16 23:15:15 +0000 |
commit | 4194d813c1b3ce78f06af0eaef02acb376c94743 (patch) | |
tree | 3e216f597b83e643ffda7517069aed8adfa92f6c /sys | |
parent | 88ab3bade32deddff57c38395d6ae58f9eee2760 (diff) | |
download | FreeBSD-src-4194d813c1b3ce78f06af0eaef02acb376c94743.zip FreeBSD-src-4194d813c1b3ce78f06af0eaef02acb376c94743.tar.gz |
In vm_thread_swap{in|out}(), remove the alpha specific conditional
compilation and replace it with a call to cpu_thread_swap{in|out}().
This allows us to add similar code on ia64 without cluttering the
code even more.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/alpha/alpha/vm_machdep.c | 17 | ||||
-rw-r--r-- | sys/amd64/amd64/vm_machdep.c | 10 | ||||
-rw-r--r-- | sys/i386/i386/vm_machdep.c | 10 | ||||
-rw-r--r-- | sys/ia64/ia64/vm_machdep.c | 10 | ||||
-rw-r--r-- | sys/powerpc/aim/vm_machdep.c | 16 | ||||
-rw-r--r-- | sys/powerpc/powerpc/vm_machdep.c | 16 | ||||
-rw-r--r-- | sys/sparc64/sparc64/vm_machdep.c | 10 | ||||
-rw-r--r-- | sys/sys/proc.h | 2 | ||||
-rw-r--r-- | sys/vm/vm_glue.c | 15 |
9 files changed, 79 insertions, 27 deletions
diff --git a/sys/alpha/alpha/vm_machdep.c b/sys/alpha/alpha/vm_machdep.c index 3611280..9139dc7 100644 --- a/sys/alpha/alpha/vm_machdep.c +++ b/sys/alpha/alpha/vm_machdep.c @@ -266,6 +266,23 @@ cpu_thread_setup(struct thread *td) } void +cpu_thread_swapin(struct thread *td) +{ + /* + * The pcb may be at a different physical address now so cache the + * new address. + */ + td->td_md.md_pcbpaddr = (void *)vtophys((vm_offset_t)td->td_pcb); +} + +void +cpu_thread_swapout(struct thread *td) +{ + /* Make sure we aren't fpcurthread. */ + alpha_fpstate_save(td, 1); +} + +void cpu_set_upcall(struct thread *td, struct thread *td0) { struct pcb *pcb2; diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index e9422af..aab07a8 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -199,6 +199,16 @@ cpu_thread_clean(struct thread *td) } void +cpu_thread_swapin(struct thread *td) +{ +} + +void +cpu_thread_swapout(struct thread *td) +{ +} + +void cpu_sched_exit(td) register struct thread *td; { diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 1341265..7cec620 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -301,6 +301,16 @@ cpu_thread_clean(struct thread *td) } void +cpu_thread_swapin(struct thread *td) +{ +} + +void +cpu_thread_swapout(struct thread *td) +{ +} + +void cpu_sched_exit(td) register struct thread *td; { diff --git a/sys/ia64/ia64/vm_machdep.c b/sys/ia64/ia64/vm_machdep.c index 77d7c64..ae8ff3b 100644 --- a/sys/ia64/ia64/vm_machdep.c +++ b/sys/ia64/ia64/vm_machdep.c @@ -122,6 +122,16 @@ cpu_thread_setup(struct thread *td) } void +cpu_thread_swapin(struct thread *td) +{ +} + +void +cpu_thread_swapout(struct thread *td) +{ +} + +void cpu_set_upcall(struct thread *td, struct thread *td0) { struct pcb *pcb; diff --git a/sys/powerpc/aim/vm_machdep.c b/sys/powerpc/aim/vm_machdep.c index ead7511..3f83f88 100644 --- a/sys/powerpc/aim/vm_machdep.c +++ b/sys/powerpc/aim/vm_machdep.c @@ -257,8 +257,6 @@ is_physical_memory(addr) void cpu_thread_exit(struct thread *td) { - - return; } void @@ -269,20 +267,24 @@ cpu_thread_clean(struct thread *td) void cpu_thread_setup(struct thread *td) { +} - return; +void +cpu_thread_swapin(struct thread *td) +{ } void -cpu_set_upcall(struct thread *td, struct thread *td0) +cpu_thread_swapout(struct thread *td) { +} - return; +void +cpu_set_upcall(struct thread *td, struct thread *td0) +{ } void cpu_set_upcall_kse(struct thread *td, struct kse_upcall *ku) { - - return; } diff --git a/sys/powerpc/powerpc/vm_machdep.c b/sys/powerpc/powerpc/vm_machdep.c index ead7511..3f83f88 100644 --- a/sys/powerpc/powerpc/vm_machdep.c +++ b/sys/powerpc/powerpc/vm_machdep.c @@ -257,8 +257,6 @@ is_physical_memory(addr) void cpu_thread_exit(struct thread *td) { - - return; } void @@ -269,20 +267,24 @@ cpu_thread_clean(struct thread *td) void cpu_thread_setup(struct thread *td) { +} - return; +void +cpu_thread_swapin(struct thread *td) +{ } void -cpu_set_upcall(struct thread *td, struct thread *td0) +cpu_thread_swapout(struct thread *td) { +} - return; +void +cpu_set_upcall(struct thread *td, struct thread *td0) +{ } void cpu_set_upcall_kse(struct thread *td, struct kse_upcall *ku) { - - return; } diff --git a/sys/sparc64/sparc64/vm_machdep.c b/sys/sparc64/sparc64/vm_machdep.c index 884b55f..983e733 100644 --- a/sys/sparc64/sparc64/vm_machdep.c +++ b/sys/sparc64/sparc64/vm_machdep.c @@ -145,6 +145,16 @@ cpu_thread_setup(struct thread *td) } void +cpu_thread_swapin(struct thread *td) +{ +} + +void +cpu_thread_swapout(struct thread *td) +{ +} + +void cpu_set_upcall(struct thread *td, struct thread *td0) { struct trapframe *tf; diff --git a/sys/sys/proc.h b/sys/sys/proc.h index a7b222a..3c46e96 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -889,6 +889,8 @@ void cpu_thread_clean(struct thread *); void cpu_thread_exit(struct thread *); void cpu_thread_setup(struct thread *td); void cpu_thread_siginfo(int sig, u_long code, siginfo_t *si); +void cpu_thread_swapin(struct thread *); +void cpu_thread_swapout(struct thread *); void kse_reassign(struct kse *ke); void kse_link(struct kse *ke, struct ksegrp *kg); void kse_unlink(struct kse *ke); diff --git a/sys/vm/vm_glue.c b/sys/vm/vm_glue.c index 5d0744b..821e511 100644 --- a/sys/vm/vm_glue.c +++ b/sys/vm/vm_glue.c @@ -498,12 +498,7 @@ vm_thread_swapout(struct thread *td) vm_page_t m; int i, pages; -#ifdef __alpha__ - /* - * Make sure we aren't fpcurthread. - */ - alpha_fpstate_save(td, 1); -#endif + cpu_thread_swapout(td); pages = td->td_kstack_pages; ksobj = td->td_kstack_obj; pmap_qremove(td->td_kstack, pages); @@ -550,13 +545,7 @@ vm_thread_swapin(struct thread *td) } VM_OBJECT_UNLOCK(ksobj); pmap_qenter(td->td_kstack, ma, pages); -#ifdef __alpha__ - /* - * The pcb may be at a different physical address now so cache the - * new address. - */ - td->td_md.md_pcbpaddr = (void *)vtophys((vm_offset_t)td->td_pcb); -#endif + cpu_thread_swapin(td); } /* |