From 06f8213bffd27360d5cc3df0cad19b102cc928e2 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Sat, 29 Oct 2011 17:32:21 -0700 Subject: [PATCH] pciTag was removed from xorg-server, so provide it in-driver until this is updated to use libpciaccess Signed-off-by: Jeremy Huddleston --- src/sispcirename.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/sispcirename.h b/src/sispcirename.h index c4beac6..54cc07f 100644 --- a/src/sispcirename.h +++ b/src/sispcirename.h @@ -29,11 +29,35 @@ #ifndef SISPCIRENAME_H #define SISPCIRENAME_H +#include + enum region_type { REGION_MEM, 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 */