vm_machdep.c (434) | vm_machdep.c (608) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986 The Regents of the University of California. 3 * Copyright (c) 1989, 1990 William Jolitz 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the Systems Programming Group of the University of Utah Computer 8 * Science Department, and William Jolitz. --- 21 unchanged lines hidden (view full) --- 30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * | 1/*- 2 * Copyright (c) 1982, 1986 The Regents of the University of California. 3 * Copyright (c) 1989, 1990 William Jolitz 4 * All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * the Systems Programming Group of the University of Utah Computer 8 * Science Department, and William Jolitz. --- 21 unchanged lines hidden (view full) --- 30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * |
38 * @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 39 * 40 * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE 41 * -------------------- ----- ---------------------- 42 * CURRENT PATCH LEVEL: 1 00154 43 * -------------------- ----- ---------------------- 44 * 45 * 20 Apr 93 Bruce Evans New npx-0.5 code 46 * 47 */ 48 49/* | 38 * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 |
50 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ | 39 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ |
40 * $Id$ |
|
51 */ | 41 */ |
52static char rcsid[] = "$Header: /usr/chroot/CVS/386BSD/src/sys/i386/i386/vm_machdep.c,v 1.3 1993/07/27 10:52:21 davidg Exp $"; | |
53 | 42 |
43#include "npx.h" |
|
54#include "param.h" 55#include "systm.h" 56#include "proc.h" 57#include "malloc.h" 58#include "buf.h" 59#include "user.h" 60 61#include "../include/cpu.h" --- 85 unchanged lines hidden (view full) --- 147 */ 148struct proc *swtch_to_inactive(); 149volatile void 150cpu_exit(p) 151 register struct proc *p; 152{ 153 static struct pcb nullpcb; /* pcb to overwrite on last swtch */ 154 | 44#include "param.h" 45#include "systm.h" 46#include "proc.h" 47#include "malloc.h" 48#include "buf.h" 49#include "user.h" 50 51#include "../include/cpu.h" --- 85 unchanged lines hidden (view full) --- 137 */ 138struct proc *swtch_to_inactive(); 139volatile void 140cpu_exit(p) 141 register struct proc *p; 142{ 143 static struct pcb nullpcb; /* pcb to overwrite on last swtch */ 144 |
155#ifdef NPX | 145#if NNPX > 0 |
156 npxexit(p); | 146 npxexit(p); |
157#endif | 147#endif /* NNPX */ |
158 159 /* move to inactive space and stack, passing arg accross */ 160 p = swtch_to_inactive(p); 161 162 /* drop per-process resources */ 163 vmspace_free(p->p_vmspace); 164 kmem_free(kernel_map, (vm_offset_t)p->p_addr, ctob(UPAGES)); 165 166 p->p_addr = (struct user *) &nullpcb; 167 splclock(); 168 swtch(); 169 /* NOTREACHED */ 170} 171#else 172void 173cpu_exit(p) 174 register struct proc *p; 175{ 176 | 148 149 /* move to inactive space and stack, passing arg accross */ 150 p = swtch_to_inactive(p); 151 152 /* drop per-process resources */ 153 vmspace_free(p->p_vmspace); 154 kmem_free(kernel_map, (vm_offset_t)p->p_addr, ctob(UPAGES)); 155 156 p->p_addr = (struct user *) &nullpcb; 157 splclock(); 158 swtch(); 159 /* NOTREACHED */ 160} 161#else 162void 163cpu_exit(p) 164 register struct proc *p; 165{ 166 |
177#ifdef NPX | 167#if NNPX > 0 |
178 npxexit(p); | 168 npxexit(p); |
179#endif | 169#endif /* NNPX */ |
180 splclock(); 181 swtch(); 182 /* 183 * This is to shutup the compiler, and if swtch() failed I suppose 184 * this would be a good thing. This keeps gcc happy because panic 185 * is a volatile void function as well. 186 */ 187 panic("cpu_exit"); --- 115 unchanged lines hidden (view full) --- 303 return(0); 304 pde = (struct pde *)((u_int)u.u_procp->p_p0br + u.u_procp->p_szpt * NBPG); 305 ix = (addr & PD_MASK) >> PD_SHIFT; 306 cnt = ((addr + count + (1 << PD_SHIFT) - 1) & PD_MASK) >> PD_SHIFT; 307 cnt -= ix; 308 for (pde += ix; cnt; cnt--, pde++) 309 if (pde->pd_v == 0) 310 return(0); | 170 splclock(); 171 swtch(); 172 /* 173 * This is to shutup the compiler, and if swtch() failed I suppose 174 * this would be a good thing. This keeps gcc happy because panic 175 * is a volatile void function as well. 176 */ 177 panic("cpu_exit"); --- 115 unchanged lines hidden (view full) --- 293 return(0); 294 pde = (struct pde *)((u_int)u.u_procp->p_p0br + u.u_procp->p_szpt * NBPG); 295 ix = (addr & PD_MASK) >> PD_SHIFT; 296 cnt = ((addr + count + (1 << PD_SHIFT) - 1) & PD_MASK) >> PD_SHIFT; 297 cnt -= ix; 298 for (pde += ix; cnt; cnt--, pde++) 299 if (pde->pd_v == 0) 300 return(0); |
311 ix = btop(addr-0xfe000000); 312 cnt = btop(addr-0xfe000000+count+NBPG-1); | 301 ix = btop(addr-KERNBASE); 302 cnt = btop(addr-KERNBASE+count+NBPG-1); |
313 if (cnt > (int)&Syssize) 314 return(0); 315 cnt -= ix; 316 for (pte = &Sysmap[ix]; cnt; cnt--, pte++) 317 if (pte->pg_v == 0 /*|| (rw == B_WRITE && pte->pg_prot == 1)*/) 318 return(0); 319 return(1); 320} --- 105 unchanged lines hidden --- | 303 if (cnt > (int)&Syssize) 304 return(0); 305 cnt -= ix; 306 for (pte = &Sysmap[ix]; cnt; cnt--, pte++) 307 if (pte->pg_v == 0 /*|| (rw == B_WRITE && pte->pg_prot == 1)*/) 308 return(0); 309 return(1); 310} --- 105 unchanged lines hidden --- |