Rename BUS_DMAMEM_NOSYNC to BUS_DMA_COHERENT.

The current name is confusing, because it indicates to
the client that a bus_dmamap_sync() operation is not
necessary when the flag is specified, which is wrong.

The main purpose of this flag is to hint the underlying
architecture that DMA memory should be mapped in a coherent
way, but the architecture can ignore it.  But if the
architecture does supports coherent mapping of memory, then
it makes bus_dmamap_sync() calls cheap.

This flag is the same as the one in NetBSD's Bus DMA.

Reviewed by: gibbs, scottl, des (implicitly)
Approved by: re@ (jhb)
This commit is contained in:
Hiten Pandya 2003-05-30 20:40:33 +00:00
parent 6d7f268ad1
commit b77c32a07e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=115416
7 changed files with 8 additions and 9 deletions

View file

@ -469,7 +469,7 @@ void busspace_generic_barrier(struct alpha_busspace *space,
#define BUS_DMA_WAITOK 0x00 /* safe to sleep (pseudo-flag) */
#define BUS_DMA_NOWAIT 0x01 /* not safe to sleep */
#define BUS_DMA_ALLOCNOW 0x02 /* perform resource allocation now */
#define BUS_DMAMEM_NOSYNC 0x04 /* map memory to not require sync */
#define BUS_DMA_COHERENT 0x04 /* hint: map memory in a coherent way */
#define BUS_DMA_ISA 0x10 /* map memory for ISA dma */
#define BUS_DMA_BUS2 0x20 /* placeholders for bus functions... */
#define BUS_DMA_BUS3 0x40

View file

@ -78,7 +78,7 @@
#define BUS_DMA_WAITOK 0x00 /* safe to sleep (pseudo-flag) */
#define BUS_DMA_NOWAIT 0x01 /* not safe to sleep */
#define BUS_DMA_ALLOCNOW 0x02 /* perform resource allocation now */
#define BUS_DMAMEM_NOSYNC 0x04 /* map memory to not require sync */
#define BUS_DMA_COHERENT 0x04 /* hint map memory in a coherent way */
#define BUS_DMA_BUS1 0x10 /* placeholders for bus functions... */
#define BUS_DMA_BUS2 0x20
#define BUS_DMA_BUS3 0x40

View file

@ -78,7 +78,7 @@
#define BUS_DMA_WAITOK 0x00 /* safe to sleep (pseudo-flag) */
#define BUS_DMA_NOWAIT 0x01 /* not safe to sleep */
#define BUS_DMA_ALLOCNOW 0x02 /* perform resource allocation now */
#define BUS_DMAMEM_NOSYNC 0x04 /* map memory to not require sync */
#define BUS_DMA_COHERENT 0x04 /* hint: map memory in a coherent way */
#define BUS_DMA_BUS1 0x10 /* placeholders for bus functions... */
#define BUS_DMA_BUS2 0x20
#define BUS_DMA_BUS3 0x40

View file

@ -1607,7 +1607,7 @@ itjc_attach(device_t dev)
ITJC_DMA_POOL_BYTES, /* maxsize*/
1, /* nsegments*/
ITJC_DMA_POOL_BYTES, /* maxsegsz*/
BUS_DMA_ALLOCNOW | BUS_DMAMEM_NOSYNC, /* flags*/
BUS_DMA_ALLOCNOW | BUS_DMA_COHERENT, /* flags*/
&ctx->tag);
if (error)
@ -1621,7 +1621,7 @@ itjc_attach(device_t dev)
error = bus_dmamem_alloc(
ctx->tag, /* DMA tag */
(void **)&ctx->pool, /* KV addr of the allocated memory */
BUS_DMA_NOWAIT | BUS_DMAMEM_NOSYNC, /* flags */
BUS_DMA_NOWAIT | BUS_DMA_COHERENT, /* flags */
&ctx->map); /* KV <-> PCI map */
if (error)

View file

@ -851,7 +851,7 @@ bus_space_copy_region_8(bus_space_tag_t bst, bus_space_handle_t bsh1,
#define BUS_DMA_WAITOK 0x00 /* safe to sleep (pseudo-flag) */
#define BUS_DMA_NOWAIT 0x01 /* not safe to sleep */
#define BUS_DMA_ALLOCNOW 0x02 /* perform resource allocation now */
#define BUS_DMAMEM_NOSYNC 0x04 /* map memory to not require sync */
#define BUS_DMA_COHERENT 0x04 /* hint: map memory in a coherent way */
#define BUS_DMA_ISA 0x10 /* map memory for ISA dma */
#define BUS_DMA_BUS2 0x20 /* placeholders for bus functions... */
#define BUS_DMA_BUS3 0x40

View file

@ -881,7 +881,7 @@ memsetw(void *d, int val, size_t size)
#define BUS_DMA_WAITOK 0x000 /* safe to sleep (pseudo-flag) */
#define BUS_DMA_NOWAIT 0x001 /* not safe to sleep */
#define BUS_DMA_ALLOCNOW 0x002 /* perform resource allocation now */
#define BUS_DMAMEM_NOSYNC 0x004 /* map memory to not require sync */
#define BUS_DMA_COHERENT 0x004 /* hint: map memory in a coherent way */
#define BUS_DMA_NOWRITE 0x008
#define BUS_DMA_BUS1 0x010
#define BUS_DMA_BUS2 0x020
@ -895,7 +895,6 @@ memsetw(void *d, int val, size_t size)
#define BUS_DMA_STREAMING 0x100 /* hint: sequential, unidirectional */
#define BUS_DMA_READ 0x200 /* mapping is device -> memory only */
#define BUS_DMA_WRITE 0x400 /* mapping is memory -> device only */
#define BUS_DMA_COHERENT 0x800 /* hint: map memory DMA coherent */
#define BUS_DMA_NOCACHE BUS_DMA_BUS1
/* Don't bother with alignment */

View file

@ -78,7 +78,7 @@
#define BUS_DMA_WAITOK 0x00 /* safe to sleep (pseudo-flag) */
#define BUS_DMA_NOWAIT 0x01 /* not safe to sleep */
#define BUS_DMA_ALLOCNOW 0x02 /* perform resource allocation now */
#define BUS_DMAMEM_NOSYNC 0x04 /* map memory to not require sync */
#define BUS_DMA_COHERENT 0x04 /* hint: map memory in a coherent way */
#define BUS_DMA_BUS1 0x10 /* placeholders for bus functions... */
#define BUS_DMA_BUS2 0x20
#define BUS_DMA_BUS3 0x40