Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-4]: src/sys/arch/sparc/sparc Pull up revision 1.37 (requested b...
details: https://anonhg.NetBSD.org/src/rev/a439efd500bb
branches: netbsd-1-4
changeset: 470032:a439efd500bb
user: he <he%NetBSD.org@localhost>
date: Sat Jan 15 16:56:13 2000 +0000
description:
Pull up revision 1.37 (requested by pk):
Allow old sbus cards with 24-bit devices (e.g. lance) to be
configured correctly on sun4m machines.
diffstat:
sys/arch/sparc/sparc/iommu.c | 40 +++++++++++++++++++++++++++++++++-------
1 files changed, 33 insertions(+), 7 deletions(-)
diffs (75 lines):
diff -r de5bc6546254 -r a439efd500bb sys/arch/sparc/sparc/iommu.c
--- a/sys/arch/sparc/sparc/iommu.c Sat Jan 15 16:50:53 2000 +0000
+++ b/sys/arch/sparc/sparc/iommu.c Sat Jan 15 16:56:13 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: iommu.c,v 1.32.2.1 1999/04/23 15:12:24 perry Exp $ */
+/* $NetBSD: iommu.c,v 1.32.2.2 2000/01/15 16:56:13 he Exp $ */
/*
* Copyright (c) 1996
@@ -460,6 +460,7 @@
bus_addr_t boundary;
vaddr_t va = (vaddr_t)buf;
u_long align, voff;
+ u_long ex_start, ex_end;
pmap_t pmap;
int s, error;
@@ -483,8 +484,21 @@
boundary = map->_dm_boundary;
s = splhigh();
- error = extent_alloc1(iommu_dvmamap, sgsize, align, va & (align-1),
- boundary, EX_NOWAIT, (u_long *)&dva);
+
+ /* Check `24 address bits' in the map's attributes */
+ if ((map->_dm_flags & BUS_DMA_24BIT) != 0) {
+ ex_start = D24_DVMA_BASE;
+ ex_end = D24_DVMA_END;
+ } else {
+ ex_start = iommu_dvmamap->ex_start;
+ ex_end = iommu_dvmamap->ex_end;
+ }
+ error = extent_alloc_subregion1(iommu_dvmamap,
+ ex_start, ex_end,
+ sgsize, align, va & (align-1), boundary,
+ (flags & BUS_DMA_NOWAIT) == 0
+ ? EX_WAITOK : EX_NOWAIT,
+ (u_long *)&dva);
splx(s);
if (error != 0)
@@ -634,6 +648,7 @@
bus_addr_t dva;
vm_page_t m;
int s, error;
+ u_long ex_start, ex_end;
struct pglist *mlist;
size = round_page(size);
@@ -643,10 +658,21 @@
return (error);
s = splhigh();
- error = extent_alloc(iommu_dvmamap, size, alignment, boundary,
- (flags & BUS_DMA_NOWAIT) == 0
- ? EX_WAITOK : EX_NOWAIT,
- (u_long *)&dva);
+
+ if ((flags & BUS_DMA_24BIT) != 0) {
+ ex_start = D24_DVMA_BASE;
+ ex_end = D24_DVMA_END;
+ } else {
+ ex_start = iommu_dvmamap->ex_start;
+ ex_end = iommu_dvmamap->ex_end;
+ }
+
+ error = extent_alloc_subregion(iommu_dvmamap,
+ ex_start, ex_end,
+ size, alignment, boundary,
+ (flags & BUS_DMA_NOWAIT) == 0
+ ? EX_WAITOK : EX_NOWAIT,
+ (u_long *)&dva);
splx(s);
if (error != 0)
return (error);
Home |
Main Index |
Thread Index |
Old Index