summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2009-09-17 19:26:54 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2009-09-17 19:26:54 +0000
commit0563bf644d37b669c9f366e9c51f4af81d7fa87c (patch)
treeb35382540c0ef12a50b910698056142f1cf3db79 /sys
parent5d846f683c64bf79d9c13621e98dfc4c5925f306 (diff)
Return a dense mapping for BUS_SPACE_MAP_PREFETCHABLE mappings; repaires
tga on non-bwx machines. Reported and fix tested by kurt@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/alpha/pci/pci_swiz_bus_mem_chipdep.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/arch/alpha/pci/pci_swiz_bus_mem_chipdep.c b/sys/arch/alpha/pci/pci_swiz_bus_mem_chipdep.c
index b4fda0fd8c1..4d37cb7d092 100644
--- a/sys/arch/alpha/pci/pci_swiz_bus_mem_chipdep.c
+++ b/sys/arch/alpha/pci/pci_swiz_bus_mem_chipdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_swiz_bus_mem_chipdep.c,v 1.6 2009/07/30 21:39:15 miod Exp $ */
+/* $OpenBSD: pci_swiz_bus_mem_chipdep.c,v 1.7 2009/09/17 19:26:53 miod Exp $ */
/* $NetBSD: pcs_bus_mem_common.c,v 1.15 1996/12/02 22:19:36 cgd Exp $ */
/*
@@ -487,9 +487,17 @@ __C(CHIP,_mem_map)(v, memaddr, memsize, flags, memhp)
{
bus_space_handle_t dh = 0, sh = 0; /* XXX -Wuninitialized */
int didd, dids, errord, errors, mustd, musts;
+ int prefetchable = flags & BUS_SPACE_MAP_PREFETCHABLE;
+ int linear = flags & BUS_SPACE_MAP_LINEAR;
mustd = 1;
- musts = (flags & BUS_SPACE_MAP_CACHEABLE) == 0;
+ musts = prefetchable == 0;
+
+ /*
+ * We must have dense space to map memory linearly.
+ */
+ if (linear && !prefetchable)
+ return (EOPNOTSUPP);
#ifdef EXTENT_DEBUG
printf("mem: allocating 0x%lx to 0x%lx\n", memaddr,
@@ -542,7 +550,7 @@ __C(CHIP,_mem_map)(v, memaddr, memsize, flags, memhp)
__S(__C(CHIP,_mem_map)), memaddr);
}
- if (flags & BUS_SPACE_MAP_CACHEABLE)
+ if (prefetchable)
*memhp = dh;
else
*memhp = sh;