Rather than exclude bounce buffers support with NOBOUNCE, include it

with BOUNCE_BUFFERS. This is more intuitive, and is better for future
multiplatform support. Added BOUNCE_BUFFERS option to the GENERIC and
LINT kernel config files.
This commit is contained in:
David Greenman 1994-08-31 06:17:49 +00:00
parent 5510f449aa
commit 9aba88bf29
14 changed files with 41 additions and 33 deletions

View file

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.56 1994/08/24 11:45:19 sos Exp $
* $Id: machdep.c,v 1.57 1994/08/27 16:14:12 davidg Exp $
*/
#include "npx.h"
@ -255,7 +255,7 @@ again:
valloc(swbuf, struct buf, nswbuf);
valloc(buf, struct buf, nbuf);
#ifndef NOBOUNCE
#ifdef BOUNCE_BUFFERS
/*
* If there is more than 16MB of memory, allocate some bounce buffers
*/
@ -321,7 +321,7 @@ again:
printf("using %d buffers containing %d bytes of memory\n",
nbuf, bufpages * CLBYTES);
#ifndef NOBOUNCE
#ifdef BOUNCE_BUFFERS
/*
* init bounce buffers
*/

View file

@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
* $Id: vm_machdep.c,v 1.25 1994/08/07 03:31:52 davidg Exp $
* $Id: vm_machdep.c,v 1.26 1994/08/07 14:53:11 davidg Exp $
*/
#include "npx.h"
@ -55,7 +55,7 @@
#include <vm/vm.h>
#include <vm/vm_kern.h>
#ifndef NOBOUNCE
#ifdef BOUNCE_BUFFERS
vm_map_t io_map;
volatile int kvasfreecnt;
@ -512,7 +512,7 @@ vm_bounce_init()
bouncefree = bouncepages;
}
#endif /* NOBOUNCE */
#endif /* BOUNCE_BUFFERS */
/*
* quick version of vm_fault
*/

View file

@ -4,7 +4,7 @@
#
# This kernel is NOT MEANT to be runnable!
#
# $Id: LINT,v 1.73 1994/08/27 16:23:03 davidg Exp $
# $Id: LINT,v 1.74 1994/08/28 06:46:25 davidg Exp $
#
machine "i386"
@ -44,6 +44,8 @@ options "BLANK_SAVER" #syscons "blank" screen saver
#options ALLOW_CONFLICT_IOADDR #no IO addr conflict checks (PS/2 mice)
#options ALLOW_CONFLICT_IRQ #no IRQ conflict checks (mport serial)
options BOUNCE_BUFFERS #include support for DMA bounce buffers
options "TCP_COMPAT_42" #tcp/ip compatible with 4.2
# ^^^ NOT RECOMMENDED FOR NORMAL USE
options UCONSOLE #x console support

View file

@ -1,7 +1,7 @@
#
# GENERICAH -- Generic machine with WD/AHx family disks
#
# $Id: GENERICAH,v 1.36 1994/08/09 08:17:08 davidg Exp $
# $Id: GENERICAH,v 1.37 1994/08/19 00:00:38 phk Exp $
#
machine "i386"
@ -35,6 +35,7 @@ options "FAT_CURSOR" #block cursor in syscons or pccons
options "SCSI_DELAY=15" #Be pessimistic about Joe SCSI device
options "NCONS=4" #4 virtual consoles
options "STAR_SAVER" #syscons "stars" screen saver
options BOUNCE_BUFFERS #include support for DMA bounce buffers
config kernel root on wd0 swap on wd0 and wd1 and sd0 and sd1 dumps on wd0

View file

@ -1,7 +1,7 @@
#
# GENERICBT -- Generic machine with WD/BTx family disks
#
# $Id: GENERICBT,v 1.35 1994/07/28 05:53:44 davidg Exp $
# $Id: GENERICBT,v 1.36 1994/08/09 08:17:09 davidg Exp $
#
machine "i386"
@ -35,6 +35,7 @@ options "FAT_CURSOR" #block cursor in syscons or pccons
options "SCSI_DELAY=15" #Be pessimistic about Joe SCSI device
options "NCONS=4" #4 virtual consoles
options "STAR_SAVER" #syscons "stars" screen saver
options BOUNCE_BUFFERS #include support for DMA bounce buffers
config kernel root on wd0 swap on wd0 and wd1 and sd0 and sd1 dumps on wd0

View file

@ -4,7 +4,7 @@
#
# This kernel is NOT MEANT to be runnable!
#
# $Id: LINT,v 1.73 1994/08/27 16:23:03 davidg Exp $
# $Id: LINT,v 1.74 1994/08/28 06:46:25 davidg Exp $
#
machine "i386"
@ -44,6 +44,8 @@ options "BLANK_SAVER" #syscons "blank" screen saver
#options ALLOW_CONFLICT_IOADDR #no IO addr conflict checks (PS/2 mice)
#options ALLOW_CONFLICT_IRQ #no IRQ conflict checks (mport serial)
options BOUNCE_BUFFERS #include support for DMA bounce buffers
options "TCP_COMPAT_42" #tcp/ip compatible with 4.2
# ^^^ NOT RECOMMENDED FOR NORMAL USE
options UCONSOLE #x console support

View file

@ -4,7 +4,7 @@
#
# This kernel is NOT MEANT to be runnable!
#
# $Id: LINT,v 1.73 1994/08/27 16:23:03 davidg Exp $
# $Id: LINT,v 1.74 1994/08/28 06:46:25 davidg Exp $
#
machine "i386"
@ -44,6 +44,8 @@ options "BLANK_SAVER" #syscons "blank" screen saver
#options ALLOW_CONFLICT_IOADDR #no IO addr conflict checks (PS/2 mice)
#options ALLOW_CONFLICT_IRQ #no IRQ conflict checks (mport serial)
options BOUNCE_BUFFERS #include support for DMA bounce buffers
options "TCP_COMPAT_42" #tcp/ip compatible with 4.2
# ^^^ NOT RECOMMENDED FOR NORMAL USE
options UCONSOLE #x console support

View file

@ -35,7 +35,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 7.4 (Berkeley) 6/3/91
* $Id: machdep.c,v 1.56 1994/08/24 11:45:19 sos Exp $
* $Id: machdep.c,v 1.57 1994/08/27 16:14:12 davidg Exp $
*/
#include "npx.h"
@ -255,7 +255,7 @@ again:
valloc(swbuf, struct buf, nswbuf);
valloc(buf, struct buf, nbuf);
#ifndef NOBOUNCE
#ifdef BOUNCE_BUFFERS
/*
* If there is more than 16MB of memory, allocate some bounce buffers
*/
@ -321,7 +321,7 @@ again:
printf("using %d buffers containing %d bytes of memory\n",
nbuf, bufpages * CLBYTES);
#ifndef NOBOUNCE
#ifdef BOUNCE_BUFFERS
/*
* init bounce buffers
*/

View file

@ -38,7 +38,7 @@
*
* from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91
* Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$
* $Id: vm_machdep.c,v 1.25 1994/08/07 03:31:52 davidg Exp $
* $Id: vm_machdep.c,v 1.26 1994/08/07 14:53:11 davidg Exp $
*/
#include "npx.h"
@ -55,7 +55,7 @@
#include <vm/vm.h>
#include <vm/vm_kern.h>
#ifndef NOBOUNCE
#ifdef BOUNCE_BUFFERS
vm_map_t io_map;
volatile int kvasfreecnt;
@ -512,7 +512,7 @@ vm_bounce_init()
bouncefree = bouncepages;
}
#endif /* NOBOUNCE */
#endif /* BOUNCE_BUFFERS */
/*
* quick version of vm_fault
*/

View file

@ -16,7 +16,7 @@
* 4. Modifications may be freely made to this file if the above conditions
* are met.
*
* $Id: vfs_bio.c,v 1.9 1994/08/18 22:35:06 wollman Exp $
* $Id: vfs_bio.c,v 1.10 1994/08/30 18:19:11 davidg Exp $
*/
#include <sys/param.h>
@ -608,8 +608,10 @@ biodone(register struct buf *bp)
vwakeup(bp);
}
#ifdef BOUNCE_BUFFERS
if (bp->b_flags & B_BOUNCE)
vm_bounce_free(bp);
#endif
/* call optional completion function if requested */
if (bp->b_flags & B_CALL) {

View file

@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
*
* $Id: cd.c,v 1.20 1994/08/27 16:14:31 davidg Exp $
* $Id: cd.c,v 1.21 1994/08/29 21:25:11 ache Exp $
*/
#define SPLCD splbio
@ -424,7 +424,7 @@ cdstrategy(bp)
/*
* Use a bounce buffer if necessary
*/
#ifndef NOBOUNCE
#ifdef BOUNCE_BUFFERS
if (cd->sc_link->flags & SDEV_BOUNCE)
vm_bounce_alloc(bp);
#endif

View file

@ -8,7 +8,7 @@
* file.
*
* Written by Julian Elischer (julian@dialix.oz.au)
* $Id: scsi_base.c,v 1.10 1994/08/20 03:48:58 davidg Exp $
* $Id: scsi_base.c,v 1.11 1994/08/27 16:14:33 davidg Exp $
*/
#define SPLSD splbio
@ -440,10 +440,10 @@ scsi_scsi_cmd(sc_link, scsi_cmd, cmdlen, data_addr, datalen,
retval = EFAULT;
goto bad;
}
#ifdef NOBOUNCE
xs->data = malloc(datalen, M_TEMP, M_WAITOK);
#else
#ifdef BOUNCE_BUFFERS
xs->data = (caddr_t) vm_bounce_kva_alloc( (datalen + PAGE_SIZE - 1)/PAGE_SIZE);
#else
xs->data = malloc(datalen, M_TEMP, M_WAITOK);
#endif
/* I think waiting is ok *//*XXX */
switch ((int)(flags & (SCSI_DATA_IN | SCSI_DATA_OUT))) {
@ -527,10 +527,10 @@ retry:
bcopy(xs->data, data_addr, datalen);
break;
}
#ifdef NOBOUNCE
free(xs->data, M_TEMP);
#else
#ifdef BOUNCE_BUFFERS
vm_bounce_kva_alloc_free(xs->data, (datalen + PAGE_SIZE - 1)/PAGE_SIZE, 0);
#else
free(xs->data, M_TEMP);
#endif
}
/*

View file

@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992
*
* $Id: sd.c,v 1.27 1994/08/30 00:12:11 jkh Exp $
* $Id: sd.c,v 1.28 1994/08/30 14:31:38 ache Exp $
*/
#define SPLSD splbio
@ -419,12 +419,10 @@ sdstrategy(bp)
/*
* Use a bounce buffer if necessary
*/
/*
#ifndef NOBOUNCE
#ifdef BOUNCE_BUFFERS
if (sd->sc_link->flags & SDEV_BOUNCE)
vm_bounce_alloc(bp);
#endif
*/
/*
* Place it in the queue of disk activities for this disk

View file

@ -12,7 +12,7 @@
* on the understanding that TFS is not responsible for the correct
* functioning of this software in any circumstances.
*
* $Id$
* $Id: st.c,v 1.17 1994/08/02 07:52:34 davidg Exp $
*/
/*
@ -904,7 +904,7 @@ ststrategy(bp)
/*
* Use a bounce buffer if necessary
*/
#ifndef NOBOUNCE
#ifdef BOUNCE_BUFFERS
if (st->sc_link->flags & SDEV_BOUNCE)
vm_bounce_alloc(bp);
#endif