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.
This commit is contained in:
Marcel Moolenaar 2003-08-16 23:15:15 +00:00
parent b0fed5c6b6
commit 710338e94f
9 changed files with 79 additions and 27 deletions

View File

@ -265,6 +265,23 @@ cpu_thread_setup(struct thread *td)
td->td_frame = (struct trapframe *)((caddr_t)td->td_pcb) - 1;
}
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)
{

View File

@ -198,6 +198,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;

View File

@ -300,6 +300,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;

View File

@ -121,6 +121,16 @@ cpu_thread_setup(struct thread *td)
td->td_frame->tf_length = sizeof(struct trapframe);
}
void
cpu_thread_swapin(struct thread *td)
{
}
void
cpu_thread_swapout(struct thread *td)
{
}
void
cpu_set_upcall(struct thread *td, struct thread *td0)
{

View File

@ -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_thread_swapout(struct thread *td)
{
}
void
cpu_set_upcall(struct thread *td, struct thread *td0)
{
return;
}
void
cpu_set_upcall_kse(struct thread *td, struct kse_upcall *ku)
{
return;
}

View File

@ -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_thread_swapout(struct thread *td)
{
}
void
cpu_set_upcall(struct thread *td, struct thread *td0)
{
return;
}
void
cpu_set_upcall_kse(struct thread *td, struct kse_upcall *ku)
{
return;
}

View File

@ -144,6 +144,16 @@ cpu_thread_setup(struct thread *td)
td->td_pcb = pcb;
}
void
cpu_thread_swapin(struct thread *td)
{
}
void
cpu_thread_swapout(struct thread *td)
{
}
void
cpu_set_upcall(struct thread *td, struct thread *td0)
{

View File

@ -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);

View File

@ -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);
}
/*