tf->tf_pidr1 = tf->tf_pidr2 = p2->p_vmspace->vm_map.pmap->pmap_pid;
tf->tf_eiem = ~0; tf->tf_ipsw = PSW_C | PSW_Q | PSW_P | PSW_D | PSW_I ; pcbp->pcb_fpregs[32] = 0; #endif
cpu_fork(p1, p2, stack, stacksize)	struct proc *p1, *p2;	void *stack;	size_t stacksize;{	register struct pcb *pcbp;	register struct trapframe *tf;	register_t sp;#ifdef DIAGNOSTIC	if (round_page(sizeof(struct user)) > NBPG)		panic("USPACE too small for user");#endif	pcbp = &p2->p_addr->u_pcb;	*pcbp = p1->p_addr->u_pcb;	/* space is cached for the copy{in,out}'s pleasure */	pcbp->pcb_space = p2->p_vmspace->vm_map.pmap->pmap_space;	pcbp->pcb_uva = (vaddr_t)p2->p_addr;	sp = (register_t)p2->p_addr + NBPG;	p2->p_md.md_regs = tf = (struct trapframe *)sp;	sp += sizeof(struct trapframe);	*tf = *p1->p_md.md_regs;	/*	 * cpu_swapin() is supposed to fill out all the PAs	 * we gonna need in locore	 */	cpu_swapin(p2);	tf->tf_sr0 = tf->tf_sr1 = tf->tf_sr2 = tf->tf_sr3 =	tf->tf_sr4 = tf->tf_sr5 = tf->tf_sr6 =		p2->p_vmspace->vm_map.pmap->pmap_space;	tf->tf_iisq_head = tf->tf_iisq_tail =		p2->p_vmspace->vm_map.pmap->pmap_space;	tf->tf_sr7 = HPPA_SID_KERNEL;	tf->tf_pidr1 = tf->tf_pidr2 = p2->p_vmspace->vm_map.pmap->pmap_pid;	/*	 * If specified, give the child a different stack.	 */	if (stack != NULL)		tf->tf_sp = (register_t)stack;	/*	 * Build a stack frame for the cpu_switch & co.	 */	sp += HPPA_FRAME_SIZE + 16*4; /* std frame + calee-save registers */	*HPPA_FRAME_CARG(0, sp) = tf->tf_sp;	*HPPA_FRAME_CARG(1, sp) = KERNMODE(child_return);	*HPPA_FRAME_CARG(2, sp) = (register_t)p2;	*(register_t*)(sp + HPPA_FRAME_PSP) = sp;	*(register_t*)(sp + HPPA_FRAME_CRP) =		(register_t)switch_trampoline;	tf->tf_sp = sp;	fdcache(HPPA_SID_KERNEL, (vaddr_t)p2->p_addr, sp - (vaddr_t)p2->p_addr);}