diff options
author | dyson <dyson@FreeBSD.org> | 1996-02-04 22:09:12 +0000 |
---|---|---|
committer | dyson <dyson@FreeBSD.org> | 1996-02-04 22:09:12 +0000 |
commit | f8428b2cd3ed0f7863f011c9f43a6ab88e8a8a4e (patch) | |
tree | 5297a6949c9f87c72275bc64891e478ffb9fbbd2 /sys/amd64 | |
parent | c0534275170b3269a4899ce19e63dc45e6d1dd88 (diff) | |
download | FreeBSD-src-f8428b2cd3ed0f7863f011c9f43a6ab88e8a8a4e.zip FreeBSD-src-f8428b2cd3ed0f7863f011c9f43a6ab88e8a8a4e.tar.gz |
Changed vm_fault_quick in vm_machdep.c to be global. Needed for
new pipe code.
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/vm_machdep.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 2fa2fa9..4a5590c 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -69,8 +69,6 @@ #include <i386/isa/isa.h> -static void vm_fault_quick __P((caddr_t v, int prot)); - #ifdef BOUNCE_BUFFERS static vm_offset_t vm_bounce_kva __P((int size, int waitok)); @@ -540,7 +538,7 @@ vm_bounce_init() /* * quick version of vm_fault */ -static void +void vm_fault_quick(v, prot) caddr_t v; int prot; @@ -564,8 +562,8 @@ int cpu_fork(p1, p2) register struct proc *p1, *p2; { - struct pcb *pcb2 = &p2->p_addr->u_pcb; - int sp, offset; + register struct user *up = p2->p_addr; + int offset; /* * Copy pcb and stack from proc p1 to p2. @@ -573,25 +571,23 @@ cpu_fork(p1, p2) * part of the stack. The stack and pcb need to agree; * this is tricky, as the final pcb is constructed by savectx, * but its frame isn't yet on the stack when the stack is copied. + * swtch compensates for this when the child eventually runs. * This should be done differently, with a single call * that copies and updates the pcb+stack, * replacing the bcopy and savectx. */ - - __asm __volatile("movl %%esp,%0" : "=r" (sp)); - offset = sp - (int)kstack; - + p2->p_addr->u_pcb = p1->p_addr->u_pcb; + offset = mvesp() - (int)kstack; bcopy((caddr_t)kstack + offset, (caddr_t)p2->p_addr + offset, (unsigned) ctob(UPAGES) - offset); p2->p_md.md_regs = p1->p_md.md_regs; - *pcb2 = p1->p_addr->u_pcb; - pcb2->pcb_cr3 = vtophys(p2->p_vmspace->vm_pmap.pm_pdir); + pmap_activate(&p2->p_vmspace->vm_pmap, &up->u_pcb); /* - * Returns (0) in parent, (1) in child. + * Return (0) in parent, (1) in child. */ - return (savectx(pcb2)); + return (savectx(&up->u_pcb)); } void |