summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2011-10-29 16:58:41 -0700
committerJeremy Huddleston <jeremyhu@apple.com>2011-10-29 16:58:41 -0700
commit05fd00f46eb3be46d669921d11dff6fe8a5bb60b (patch)
treef06058ce9722ada689b49723f4f7f7014b76c669
parent1a4dc3fb35223b708f27746b9d30a068a046cf3a (diff)
pciTag was removed from xorg-server, so provide it in-driver until this is updated to use libpciaccess
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r--src/cir_pcirename.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/cir_pcirename.h b/src/cir_pcirename.h
index f0f5cf8..fa60a19 100644
--- a/src/cir_pcirename.h
+++ b/src/cir_pcirename.h
@@ -34,6 +34,28 @@ enum region_type {
REGION_IO
};
+#if (defined(__alpha__) || defined(__ia64__)) && defined (linux)
+#define PCI_DOM_MASK 0x01fful
+#else
+#define PCI_DOM_MASK 0x0ffu
+#endif
+
+#ifndef PCI_DOM_MASK
+# define PCI_DOM_MASK 0x0ffu
+#endif
+#define PCI_DOMBUS_MASK (((PCI_DOM_MASK) << 8) | 0x0ffu)
+
+static inline uint32_t
+pciTag(int busnum, int devnum, int funcnum)
+{
+ uint32_t tag;
+ tag = (busnum & (PCI_DOMBUS_MASK)) << 16;
+ tag |= (devnum & 0x00001fu) << 11;
+ tag |= (funcnum & 0x000007u) << 8;
+
+ return tag;
+}
+
#ifndef XSERVER_LIBPCIACCESS
/* pciVideoPtr */