diff options
author | Per Fogelstrom <pefo@cvs.openbsd.org> | 1997-07-21 11:26:11 +0000 |
---|---|---|
committer | Per Fogelstrom <pefo@cvs.openbsd.org> | 1997-07-21 11:26:11 +0000 |
commit | 63a48794a62dd4b809b68d7809a222b81bdff2b4 (patch) | |
tree | 1ed284ab3fd20aee06d723b7f983c0eee629150e /sys/arch/wgrisc/dev/dma.h | |
parent | f91963ea0e51df13dd7d636e8fd1063a28b9f27f (diff) |
SCSI copy optimizations
Diffstat (limited to 'sys/arch/wgrisc/dev/dma.h')
-rw-r--r-- | sys/arch/wgrisc/dev/dma.h | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/sys/arch/wgrisc/dev/dma.h b/sys/arch/wgrisc/dev/dma.h index 0eb2e30899f..899cd8ff838 100644 --- a/sys/arch/wgrisc/dev/dma.h +++ b/sys/arch/wgrisc/dev/dma.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dma.h,v 1.3 1997/02/17 19:08:28 pefo Exp $ */ +/* $OpenBSD: dma.h,v 1.4 1997/07/21 11:26:10 pefo Exp $ */ /* * Copyright (c) 1996 Per Fogelstrom @@ -35,6 +35,15 @@ extern vm_map_t phys_map; /* + * Little endian mips uses bounce buffer so flush + * for dma is not requiered. + */ + +#ifdef MIPSEL +#define ASC_NOFLUSH +#endif + +/* * Structure used to control dma. */ @@ -106,10 +115,9 @@ typedef struct dma_softc { int *_p = (int *)PHYS_TO_UNCACHED(pa); \ int *_v = (int *)b; \ int _n = sz; \ - while(_n > 0) { \ - *_p = htonl(*_v); \ - _p++; _v++; _n -= 4; \ - } \ + if(_n) { \ + copynswap(_v, _p, _n); \ + } \ } \ dcmd = ((d) == DMA_FROM_DEV) ? 0x30 : 0x10; \ if((a)->dma_ch == DMA_CH0) { \ @@ -151,9 +159,8 @@ typedef struct dma_softc { int *_v = (int *)(c)->req_va; \ int *_p = (int *)PHYS_TO_UNCACHED(CACHED_TO_PHYS(dma_buffer)); \ int _n = (c)->req_size - resudial; \ - while(_n > 0) { \ - *_v = htonl(*_p); \ - _p++; _v++; _n -= 4; \ - } \ + if(_n) { \ + copynswap(_p, _v, _n); \ + } \ } \ } |