PERFORCE change 32085 for review

Marcel Moolenaar marcel at FreeBSD.org
Thu May 29 18:27:26 PDT 2003


http://perforce.freebsd.org/chv.cgi?CH=32085

Change 32085 by marcel at 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


More information about the p4-projects mailing list