Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 May 2003 18:27:23 -0700 (PDT)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 32085 for review
Message-ID:  <200305300127.h4U1RND8084173@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=32085

Change 32085 by marcel@marcel_nfs on 2003/05/29 18:26:44

	Rough (ie untested) implementation of cpu_set_upcall. This is
	needed to support libthr. Has close resemblance to cpu_fork.

Affected files ...

.. //depot/projects/ia64/sys/ia64/ia64/vm_machdep.c#24 edit

Differences ...

==== //depot/projects/ia64/sys/ia64/ia64/vm_machdep.c#24 (text+ko) ====

@@ -114,6 +114,28 @@
 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305300127.h4U1RND8084173>