summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgallatin <gallatin@FreeBSD.org>1999-05-29 19:47:51 +0000
committergallatin <gallatin@FreeBSD.org>1999-05-29 19:47:51 +0000
commit58ba6a68efa86520104001a99ce34ef2d3e62049 (patch)
treeb98cd3375b78df3b8fdfbb3fc11eeb82f44c9a46
parentd6f941931f3b27efea5914acfb3a9276695a03e7 (diff)
downloadFreeBSD-src-58ba6a68efa86520104001a99ce34ef2d3e62049.zip
FreeBSD-src-58ba6a68efa86520104001a99ce34ef2d3e62049.tar.gz
When memory mapping a PCI device (like XFree86 does) on an XP1000, we must
use ALPHA_PHYS_TO_K0SEG(offset) rather than just plain offet. I've verified that this does not break other platforms (I've tested an AlphaStation 200 and a Personal Workstation 500au with this patch). As to why this works, well.. Its black magic as far as I know. I obtained this hack from Myricom, who in turn, obtained it from Compaq engineers. Without this hack, XFree86 cannot talk to a PCI graphics card. Reviewed by: Doug Rabson <dfr@nlsystems.com> Obtained from: feldy@myri.com (Bob Felderman)
-rw-r--r--sys/alpha/alpha/mem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/alpha/alpha/mem.c b/sys/alpha/alpha/mem.c
index 4abfcbb..4590752 100644
--- a/sys/alpha/alpha/mem.c
+++ b/sys/alpha/alpha/mem.c
@@ -38,7 +38,7 @@
*
* from: Utah $Hdr: mem.c 1.13 89/10/08$
* from: @(#)mem.c 7.2 (Berkeley) 5/9/91
- * $Id: mem.c,v 1.6 1999/04/27 11:13:20 phk Exp $
+ * $Id: mem.c,v 1.7 1999/05/25 19:32:53 dt Exp $
*/
/*
@@ -298,7 +298,7 @@ memmmap(dev_t dev, vm_offset_t offset, int prot)
*/
if ((prot & alpha_pa_access(atop((vm_offset_t)offset))) != prot)
return (-1);
- return (alpha_btop(offset));
+ return (alpha_btop(ALPHA_PHYS_TO_K0SEG(offset)));
}
/*
OpenPOWER on IntegriCloud