Nuke __VM_PMAP_HACK.

This commit is contained in:
thorpej 1997-06-12 23:57:26 +00:00
parent 7bc62c9a2d
commit 9e69444bbd
5 changed files with 25 additions and 18 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.233 1997/06/12 15:46:32 mrg Exp $ */
/* $NetBSD: machdep.c,v 1.234 1997/06/12 23:57:26 thorpej Exp $ */
/*-
* Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@ -2028,27 +2028,31 @@ _bus_dmamap_load(t, map, buf, buflen, p, flags)
bus_addr_t curaddr, lastaddr;
caddr_t vaddr = buf;
int first, seg;
if (buflen > map->_dm_size)
return (EINVAL);
pmap_t pmap;
/*
* Make sure that on error condition we return "no valid mappings".
*/
map->dm_nsegs = 0;
if (buflen > map->_dm_size)
return (EINVAL);
/*
* XXX Need to implement "don't dma across this boundry".
*/
if (p != NULL)
pmap = p->p_vmspace->vm_map.pmap;
else
pmap = pmap_kernel();
lastaddr = ~0; /* XXX gcc */
for (first = 1, seg = 0; buflen > 0 && seg < map->_dm_segcnt; ) {
/*
* Get the physical address for this segment.
*/
curaddr = (bus_addr_t)pmap_extract(p != NULL ?
&p->p_vmspace->vm_pmap : pmap_kernel(),
(vm_offset_t)vaddr);
curaddr = (bus_addr_t)pmap_extract(pmap, (vm_offset_t)vaddr);
/*
* Compute the segment size, and adjust counts.

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.42 1997/06/06 23:14:22 thorpej Exp $ */
/* $NetBSD: pmap.c,v 1.43 1997/06/12 23:57:28 thorpej Exp $ */
/*
* Copyright (c) 1993, 1994, 1995 Charles M. Hannum. All rights reserved.
@ -681,7 +681,7 @@ pmap_release(pmap)
printf("pmap_release(%p)\n", pmap);
#endif
#ifdef DIAGNOSTIC
#ifdef notdef /* DIAGNOSTIC */
/* sometimes 1, sometimes 0; could rearrange pmap_destroy */
if (pmap->pm_count != 1)
panic("pmap_release count");
@ -720,7 +720,7 @@ pmap_activate(pmap, pcb)
if (pmap /*&& pmap->pm_pdchanged */) {
pcb->pcb_cr3 =
pmap_extract(pmap_kernel(), (vm_offset_t)pmap->pm_pdir);
if (pmap == &curproc->p_vmspace->vm_pmap)
if (pmap == curproc->p_vmspace->vm_map.pmap)
lcr3(pcb->pcb_cr3);
pmap->pm_pdchanged = FALSE;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.63 1996/12/10 05:28:15 tls Exp $ */
/* $NetBSD: vm_machdep.c,v 1.64 1997/06/12 23:57:29 thorpej Exp $ */
/*-
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@ -106,7 +106,7 @@ cpu_fork(p1, p2)
/* Sync curpcb (which is presumably p1's PCB) and copy it to p2. */
savectx(curpcb);
*pcb = p1->p_addr->u_pcb;
pmap_activate(&p2->p_vmspace->vm_pmap, pcb);
pmap_activate(p2->p_vmspace->vm_map.pmap, pcb);
/*
* Preset these so that gdt_compact() doesn't get confused if called

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.h,v 1.25 1997/05/16 21:35:36 gwr Exp $ */
/* $NetBSD: pmap.h,v 1.26 1997/06/12 23:57:30 thorpej Exp $ */
/*
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@ -204,6 +204,4 @@ void pmap_activate __P((pmap_t, struct pcb *));
#endif /* _KERNEL */
#define __VM_PMAP_HACK
#endif /* _I386_PMAP_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: isa_machdep.c,v 1.21 1997/06/06 23:28:41 thorpej Exp $ */
/* $NetBSD: isa_machdep.c,v 1.22 1997/06/12 23:57:32 thorpej Exp $ */
#define ISA_DMA_STATS
@ -900,6 +900,7 @@ _isa_dma_check_buffer(buf, buflen, segcnt, boundary, p)
vm_offset_t vaddr = (vm_offset_t)buf;
vm_offset_t pa, lastpa, endva;
u_long pagemask = ~(boundary - 1);
pmap_t pmap;
int nsegs;
endva = round_page(vaddr + buflen);
@ -907,12 +908,16 @@ _isa_dma_check_buffer(buf, buflen, segcnt, boundary, p)
nsegs = 1;
lastpa = 0;
if (p != NULL)
pmap = p->p_vmspace->vm_map.pmap;
else
pmap = pmap_kernel();
for (; vaddr < endva; vaddr += NBPG) {
/*
* Get physical address for this segment.
*/
pa = pmap_extract(p != NULL ? &p->p_vmspace->vm_pmap :
pmap_kernel(), (vm_offset_t)vaddr);
pa = pmap_extract(pmap, (vm_offset_t)vaddr);
pa = trunc_page(pa);
/*