From a27ff697e2c14e4b88c6dc3374c53ed2bf826f78 Mon Sep 17 00:00:00 2001 From: rgrimes Date: Thu, 30 Sep 1993 23:16:17 +0000 Subject: [PATCH] This is a fix for the 32K DMA buffer region that was not accounted for, it relocates it to be after the BIOS memory hole instead of right below the 640K limit. THANK YOU CHRIS!!! From: Date: Wed, 29 Sep 93 18:49:58 -0700 basically, reserve a new 32k space right after firstaddr, and put the buffer space there... the diffs are below, and are in ~cgd/sys/i386/i386 (in machdep.c) on freefall. i obviously can't test them, so if some of you would look the diffs over and try them out... --- sys/amd64/amd64/pmap.c | 27 ++++++++++++--------------- sys/i386/i386/pmap.c | 27 ++++++++++++--------------- 2 files changed, 24 insertions(+), 30 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 8f6c5fa288b9..a140de863205 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -34,16 +34,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * - * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE - * -------------------- ----- ---------------------- - * CURRENT PATCH LEVEL: 1 00063 - * -------------------- ----- ---------------------- - * - * 28 Nov 1991 Poul-Henning Kamp Speedup processing. + * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 + * $Id$ */ -static char rcsid[] = "$Header: /a/cvs/386BSD/src/sys/i386/i386/pmap.c,v 1.2 1993/07/27 10:52:19 davidg Exp $"; +static char rcsid[] = "$Id$"; /* * Derived from hp300 version by Mike Hibler, this version by William @@ -229,7 +223,7 @@ pmap_bootstrap(firstaddr, loadaddr) extern vm_offset_t maxmem, physmem; extern int IdlePTD; - avail_start = firstaddr; + avail_start = firstaddr + 8 * NBPG; avail_end = maxmem << PG_SHIFT; /* XXX: allow for msgbuf */ @@ -256,6 +250,8 @@ extern int IdlePTD; /* * Create Kernel page directory table and page maps. * [ currently done in locore. i have wild and crazy ideas -wfj ] + * XXX IF THIS IS EVER USED, IT MUST BE MOVED TO THE TOP + * OF THIS ROUTINE -- cgd */ bzero(firstaddr, 4*NBPG); kernel_pmap->pm_pdir = firstaddr + VM_MIN_KERNEL_ADDRESS; @@ -294,15 +290,16 @@ extern int IdlePTD; #endif /* * reserve special hunk of memory for use by bus dma as a bounce - * buffer (contiguous virtual *and* physical memory). for now, - * assume vm does not use memory beneath hole, and we know that - * the bootstrap uses top 32k of base memory. -wfj + * buffer (contiguous virtual *and* physical memory). + * do it from firstaddr -> firstaddr+8 pages. note that + * avail_start was bumped up 8 pages, above, to accomodate this. */ { extern vm_offset_t isaphysmem; - isaphysmem = va; - virtual_avail = pmap_map(va, 0xa0000 - 32*1024, 0xa0000, VM_PROT_ALL); + isaphysmem = va; + virtual_avail = pmap_map(va, firstaddr, firstaddr + 8*NBPG, + VM_PROT_ALL); } *(int *)PTD = 0; diff --git a/sys/i386/i386/pmap.c b/sys/i386/i386/pmap.c index 8f6c5fa288b9..a140de863205 100644 --- a/sys/i386/i386/pmap.c +++ b/sys/i386/i386/pmap.c @@ -34,16 +34,10 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)pmap.c 7.7 (Berkeley) 5/12/91 - * - * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE - * -------------------- ----- ---------------------- - * CURRENT PATCH LEVEL: 1 00063 - * -------------------- ----- ---------------------- - * - * 28 Nov 1991 Poul-Henning Kamp Speedup processing. + * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 + * $Id$ */ -static char rcsid[] = "$Header: /a/cvs/386BSD/src/sys/i386/i386/pmap.c,v 1.2 1993/07/27 10:52:19 davidg Exp $"; +static char rcsid[] = "$Id$"; /* * Derived from hp300 version by Mike Hibler, this version by William @@ -229,7 +223,7 @@ pmap_bootstrap(firstaddr, loadaddr) extern vm_offset_t maxmem, physmem; extern int IdlePTD; - avail_start = firstaddr; + avail_start = firstaddr + 8 * NBPG; avail_end = maxmem << PG_SHIFT; /* XXX: allow for msgbuf */ @@ -256,6 +250,8 @@ extern int IdlePTD; /* * Create Kernel page directory table and page maps. * [ currently done in locore. i have wild and crazy ideas -wfj ] + * XXX IF THIS IS EVER USED, IT MUST BE MOVED TO THE TOP + * OF THIS ROUTINE -- cgd */ bzero(firstaddr, 4*NBPG); kernel_pmap->pm_pdir = firstaddr + VM_MIN_KERNEL_ADDRESS; @@ -294,15 +290,16 @@ extern int IdlePTD; #endif /* * reserve special hunk of memory for use by bus dma as a bounce - * buffer (contiguous virtual *and* physical memory). for now, - * assume vm does not use memory beneath hole, and we know that - * the bootstrap uses top 32k of base memory. -wfj + * buffer (contiguous virtual *and* physical memory). + * do it from firstaddr -> firstaddr+8 pages. note that + * avail_start was bumped up 8 pages, above, to accomodate this. */ { extern vm_offset_t isaphysmem; - isaphysmem = va; - virtual_avail = pmap_map(va, 0xa0000 - 32*1024, 0xa0000, VM_PROT_ALL); + isaphysmem = va; + virtual_avail = pmap_map(va, firstaddr, firstaddr + 8*NBPG, + VM_PROT_ALL); } *(int *)PTD = 0;