_ds_vaddr member in struct sgimips_bus_dma_segment is a virtual address,

so it should be vaddr_t rather than bus_addr_t.
This commit is contained in:
tsutsui 2006-04-16 08:26:41 +00:00
parent c1842c746c
commit cd453227e1
2 changed files with 9 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bus.h,v 1.18 2006/03/01 12:38:12 yamt Exp $ */
/* $NetBSD: bus.h,v 1.19 2006/04/16 08:26:41 tsutsui Exp $ */
/*
* Copyright (c) 1996, 1997, 1998, 2001 The NetBSD Foundation, Inc.
@ -514,7 +514,7 @@ typedef struct sgimips_bus_dmamap *bus_dmamap_t;
struct sgimips_bus_dma_segment {
bus_addr_t ds_addr; /* DMA address */
bus_size_t ds_len; /* length of transfer */
bus_addr_t _ds_vaddr; /* virtual address, 0 if invalid */
vaddr_t _ds_vaddr; /* virtual address, 0 if invalid */
};
typedef struct sgimips_bus_dma_segment bus_dma_segment_t;

View File

@ -1,4 +1,4 @@
/* $NetBSD: bus.c,v 1.42 2006/03/01 12:38:12 yamt Exp $ */
/* $NetBSD: bus.c,v 1.43 2006/04/16 08:26:42 tsutsui Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.42 2006/03/01 12:38:12 yamt Exp $");
__KERNEL_RCSID(0, "$NetBSD: bus.c,v 1.43 2006/04/16 08:26:42 tsutsui Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -778,7 +778,7 @@ _bus_dmamap_sync_mips3(bus_dma_tag_t t, bus_dmamap_t map, bus_addr_t offset,
bus_size_t len, int ops)
{
bus_size_t minlen;
bus_addr_t addr, start, end, preboundary, firstboundary, lastboundary;
vaddr_t vaddr, start, end, preboundary, firstboundary, lastboundary;
int i, useindex;
/*
@ -863,12 +863,12 @@ _bus_dmamap_sync_mips3(bus_dma_tag_t t, bus_dmamap_t map, bus_addr_t offset,
minlen = len < map->dm_segs[i].ds_len - offset ?
len : map->dm_segs[i].ds_len - offset;
addr = map->dm_segs[i]._ds_vaddr;
vaddr = map->dm_segs[i]._ds_vaddr;
#ifdef BUS_DMA_DEBUG
printf("bus_dmamap_sync: flushing segment %d "
"(0x%lx+%lx, 0x%lx+0x%lx) (olen = %ld)...", i,
addr, offset, addr, offset + minlen - 1, len);
vaddr, offset, vaddr, offset + minlen - 1, len);
#endif
/*
@ -876,7 +876,7 @@ _bus_dmamap_sync_mips3(bus_dma_tag_t t, bus_dmamap_t map, bus_addr_t offset,
* Write-back,Invalidate, so just do one test.
*/
if (__predict_false(useindex)) {
mips_dcache_wbinv_range_index(addr + offset, minlen);
mips_dcache_wbinv_range_index(vaddr + offset, minlen);
#ifdef BUS_DMA_DEBUG
printf("\n");
#endif
@ -887,7 +887,7 @@ _bus_dmamap_sync_mips3(bus_dma_tag_t t, bus_dmamap_t map, bus_addr_t offset,
/* The code that follows is more correct than that in
mips/bus_dma.c. */
start = addr + offset;
start = vaddr + offset;
switch (ops) {
case BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE:
mips_dcache_wbinv_range(start, minlen);