diff options
author | marcel <marcel@FreeBSD.org> | 2003-06-01 23:19:21 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-06-01 23:19:21 +0000 |
commit | 617972a65888aa53fdd1cd737ddf1f4a28c80abd (patch) | |
tree | 8dca010e530b28bcc76702d22e0801a769049dd7 /sys | |
parent | 648544852f7a39363cd8cb606a45f62d3153198e (diff) | |
download | FreeBSD-src-617972a65888aa53fdd1cd737ddf1f4a28c80abd.zip FreeBSD-src-617972a65888aa53fdd1cd737ddf1f4a28c80abd.tar.gz |
Improve on cpu_set_upcall:
o Use pcb and tf for the new pcb and the new trapframe and use pcb0
for the old (current) pcb. The mix of pcb, pcb2 and tf was slightly
confusing.
o Don't define td->td_frame here. It has already been set previously
by cpu_thread_setup. Add a KASSERT to make sure pcb and tf are both
non-NULL.
o Make sure the number of dirty registers is 0 for the new thread.
There are no user registers on the backing store because we heven't
enter userland yet.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ia64/ia64/vm_machdep.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/sys/ia64/ia64/vm_machdep.c b/sys/ia64/ia64/vm_machdep.c index 960cb39..246adeb 100644 --- a/sys/ia64/ia64/vm_machdep.c +++ b/sys/ia64/ia64/vm_machdep.c @@ -120,29 +120,29 @@ cpu_thread_setup(struct thread *td) } void -cpu_set_upcall(struct thread *td, void *pcb) +cpu_set_upcall(struct thread *td, void *pcb0) { - struct pcb *pcb2; + struct pcb *pcb; struct trapframe *tf; - pcb2 = td->td_pcb; - bcopy(pcb, pcb2, sizeof(*pcb2)); + pcb = td->td_pcb; + KASSERT(pcb != NULL, ("foo")); + bcopy(pcb0, pcb, sizeof(*pcb)); - tf = (struct trapframe *)pcb2 - 1; - td->td_frame = tf; - tf->tf_length = sizeof(struct trapframe); + tf = td->td_frame; + KASSERT(tf != NULL, ("foo")); tf->tf_flags = FRAME_SYSCALL; + tf->tf_special.ndirty = 0; tf->tf_scratch.gr8 = 0; tf->tf_scratch.gr9 = 1; tf->tf_scratch.gr10 = 0; - /* XXX */ - pcb2->pcb_special.bspstore = td->td_kstack + tf->tf_special.ndirty; - pcb2->pcb_special.pfs = 0; - pcb2->pcb_current_pmap = vmspace_pmap(td->td_proc->p_vmspace); - pcb2->pcb_special.sp = (uintptr_t)tf - 16; - pcb2->pcb_special.rp = FDESC_FUNC(fork_trampoline); + pcb->pcb_special.bspstore = td->td_kstack; + pcb->pcb_special.pfs = 0; + pcb->pcb_current_pmap = vmspace_pmap(td->td_proc->p_vmspace); + pcb->pcb_special.sp = (uintptr_t)tf - 16; + pcb->pcb_special.rp = FDESC_FUNC(fork_trampoline); cpu_set_fork_handler(td, (void (*)(void*))fork_return, td); } |