diff options
author | marcel <marcel@FreeBSD.org> | 2003-05-31 21:14:25 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-05-31 21:14:25 +0000 |
commit | 2fe9074be4de805e7a7f47a381e5d1ce9086b965 (patch) | |
tree | c81c45178cce96b07a7eda72838c1d83e7b618ea /sys | |
parent | ad5820a3d922c75263a12ed545ebaafd9a9a1e4e (diff) | |
download | FreeBSD-src-2fe9074be4de805e7a7f47a381e5d1ce9086b965.zip FreeBSD-src-2fe9074be4de805e7a7f47a381e5d1ce9086b965.tar.gz |
Implement cpu_set_upcall(). Required by libthr and used by
thr_create(2). This implementation is so far only compile tested.
But since this is also the last of the functions required to
support libthr, we're now functionally complete (for some weird
definition of functionally; and complete). Runtime testing can
commence.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ia64/ia64/vm_machdep.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sys/ia64/ia64/vm_machdep.c b/sys/ia64/ia64/vm_machdep.c index d0ecb6e..2822764 100644 --- a/sys/ia64/ia64/vm_machdep.c +++ b/sys/ia64/ia64/vm_machdep.c @@ -114,6 +114,28 @@ cpu_thread_setup(struct thread *td) void cpu_set_upcall(struct thread *td, void *pcb) { + struct pcb *pcb2; + struct trapframe *tf; + + pcb2 = td->td_pcb; + bcopy(pcb, pcb2, sizeof(*pcb2)); + + tf = (struct trapframe *)pcb2 - 1; + td->td_frame = tf; + tf->tf_length = sizeof(struct trapframe); + tf->tf_flags = FRAME_SYSCALL; + + 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); + cpu_set_fork_handler(td, (void (*)(void*))fork_return, td); } void |