summaryrefslogtreecommitdiff
path: root/src/dev/x86
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-02-01 00:02:21 -0800
committerGabe Black <gblack@eecs.umich.edu>2009-02-01 00:02:21 -0800
commit3ecc38cb8b882169fb64bf939f709326915f375e (patch)
tree08f8a5952311d17f15445f9e24b9f9c57fb054a3 /src/dev/x86
parentbb7ad80bbe565800b09c38bdc02c12f827ec9240 (diff)
downloadgem5-3ecc38cb8b882169fb64bf939f709326915f375e.tar.xz
Devices: Add support for legacy fixed IO locations in BARs.
Diffstat (limited to 'src/dev/x86')
-rw-r--r--src/dev/x86/pc.cc15
-rw-r--r--src/dev/x86/pc.hh12
2 files changed, 24 insertions, 3 deletions
diff --git a/src/dev/x86/pc.cc b/src/dev/x86/pc.cc
index 2deed95d3..3dfa50d7f 100644
--- a/src/dev/x86/pc.cc
+++ b/src/dev/x86/pc.cc
@@ -143,9 +143,8 @@ Pc::pciToDma(Addr pciAddr) const
M5_DUMMY_RETURN
}
-
Addr
-Pc::calcConfigAddr(int bus, int dev, int func)
+Pc::calcPciConfigAddr(int bus, int dev, int func)
{
assert(func < 8);
assert(dev < 32);
@@ -153,6 +152,18 @@ Pc::calcConfigAddr(int bus, int dev, int func)
return (PhysAddrPrefixPciConfig | (func << 8) | (dev << 11));
}
+Addr
+Pc::calcPciIOAddr(Addr addr)
+{
+ return PhysAddrPrefixIO + addr;
+}
+
+Addr
+Pc::calcPciMemAddr(Addr addr)
+{
+ return addr;
+}
+
Pc *
PcParams::create()
{
diff --git a/src/dev/x86/pc.hh b/src/dev/x86/pc.hh
index 21055a566..427cc4165 100644
--- a/src/dev/x86/pc.hh
+++ b/src/dev/x86/pc.hh
@@ -93,7 +93,17 @@ class Pc : public Platform
/**
* Calculate the configuration address given a bus/dev/func.
*/
- virtual Addr calcConfigAddr(int bus, int dev, int func);
+ virtual Addr calcPciConfigAddr(int bus, int dev, int func);
+
+ /**
+ * Calculate the address for an IO location on the PCI bus.
+ */
+ virtual Addr calcPciIOAddr(Addr addr);
+
+ /**
+ * Calculate the address for a memory location on the PCI bus.
+ */
+ virtual Addr calcPciMemAddr(Addr addr);
};
#endif // __DEV_PC_HH__