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)
This commit is contained in:
Andrew Gallatin 1999-05-29 19:47:51 +00:00
parent 9992be1a37
commit 4742fe7a4d

View File

@ -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)));
}
/*