summaryrefslogtreecommitdiff
path: root/xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c
diff options
context:
space:
mode:
authorkem <kem>2000-02-22 15:37:57 +0000
committerkem <kem>2000-02-22 15:37:57 +0000
commit3033c9bfc1f7d29d3c87214d33cb9c5a5bbd22f9 (patch)
treea0726451c24e98fda169a2528118b7b2315d3ca7 /xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c
parentaaf0250c05ea51b0b850b2b4675d611faccb0fe7 (diff)
Import of XFree86 3.9.18X_3_9_18
Diffstat (limited to 'xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c')
-rw-r--r--xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c b/xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c
index 3b49b3674..25c1abcbe 100644
--- a/xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c
+++ b/xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c,v 1.4 1998/09/19 12:14:59 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c,v 1.5 2000/02/08 13:13:29 eich Exp $ */
/*
* ppcPci.c - PowerPC PCI access functions
*
@@ -99,8 +99,8 @@ ppcPciInit()
* The moto machines do have different address maps on either side
* of the PCI-host bridge though.
*/
-ADDRESS motoppcBusAddrToHostAddr(PCITAG, ADDRESS);
-ADDRESS motoppcHostAddrToBusAddr(PCITAG, ADDRESS);
+ADDRESS motoppcBusAddrToHostAddr(PCITAG, PciAddrType, ADDRESS);
+ADDRESS motoppcHostAddrToBusAddr(PCITAG, PciAddrType, ADDRESS);
pciBusInfo_t motoppcPci0 = {
/* configMech */ PCI_CFG_MECH_1,
@@ -144,10 +144,11 @@ extern unsigned long motoPciMemLen = 0x3f000000;
extern unsigned long motoPciMemBaseCPU = 0xc0000000;
ADDRESS
-motoppcBusAddrToHostAddr(PCITAG tag, ADDRESS addr)
+motoppcBusAddrToHostAddr(PCITAG tag, PciAddrType type, ADDRESS addr)
{
unsigned long addr_l = (unsigned long)addr;
+ if (type == PCI_MEM) {
if (addr_l >= motoPciMemBase && addr_l < motoPciMemLen)
/*
* PCI memory space addresses [0-0x3effffff] are
@@ -164,32 +165,37 @@ motoppcBusAddrToHostAddr(PCITAG tag, ADDRESS addr)
else
FatalError("motoppcBusAddrToHostAddr: PCI addr 0x%x is not accessible to host!!!\n",
addr_l);
+ } else
+ return addr;
/*NOTREACHED*/
}
ADDRESS
-motoppcHostAddrToBusAddr(PCITAG tag, ADDRESS addr)
+motoppcHostAddrToBusAddr(PCITAG tag, PciAddrType type, ADDRESS addr)
{
unsigned long addr_l = (unsigned long)addr;
-
- if (addr_l < 0x80000000)
+
+ if (type == PCI_MEM) {
+ if (addr_l < 0x80000000)
/*
* Moto host memory [0,0x7fffffff] is seen at
* [0x80000000,0xffffffff] on PCI bus
*/
return((ADDRESS)(0x80000000 | addr_l));
-
- else if (addr_l >= motoPciMemBaseCPU && addr_l < motoPciMemBaseCPU + motoPciMemLen)
+
+ else if (addr_l >= motoPciMemBaseCPU && addr_l < motoPciMemBaseCPU + motoPciMemLen)
/*
* PCI memory space addresses [0-0x3effffff] are
* are seen at [0xc0000000,0xfeffffff] on moto host
*/
return((ADDRESS)(addr_l - (motoPciMemBaseCPU - motoPciMemBase)));
-
- else
+
+ else
FatalError("motoppcHostAddrToBusAddr: Host addr 0x%x is not accessible to PCI!!!\n",
addr_l);
+ } else
+ return addr;
/*NOTREACHED*/
}