summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2008-05-09 15:23:14 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2008-08-19 08:45:10 -0700
commit319ee20c9bd4f764297cf252723a23bb6a95051a (patch)
treea2fc819b790f67f54c51df22d6012a16a89a0e72 /src
parent2e0416cf8970ab4e3065a0109129b2121982c031 (diff)
Fix pciaccess READ_LONG to work with Sun compilers
Sun compilers don't allow nesting {} inside () apparently
Diffstat (limited to 'src')
-rw-r--r--src/nv_hw.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/nv_hw.c b/src/nv_hw.c
index ecac28f..83eeab2 100644
--- a/src/nv_hw.c
+++ b/src/nv_hw.c
@@ -653,6 +653,15 @@ static void nv30UpdateArbitrationSettings (
*lwm = graphics_lwm >> 3;
}
+#if XSERVER_LIBPCIACCESS
+static inline uint32_t
+pciaccessReadLong(struct pci_device *const dev, pciaddr_t offset) {
+ uint32_t tmp;
+ pci_device_cfg_read_u32(dev, &tmp, offset);
+ return tmp;
+}
+#endif
+
static void nForceUpdateArbitrationSettings (
unsigned VClk,
unsigned pixelDepth,
@@ -666,8 +675,7 @@ static void nForceUpdateArbitrationSettings (
struct pci_device *const dev2 = pci_device_find_by_slot(0, 0, 0, 2);
struct pci_device *const dev3 = pci_device_find_by_slot(0, 0, 0, 3);
struct pci_device *const dev5 = pci_device_find_by_slot(0, 0, 0, 5);
- uint32_t tmp;
- #define READ_LONG(num, offset) ({ pci_device_cfg_read_u32(dev##num, &tmp, (offset)); tmp; })
+# define READ_LONG(num, offset) pciaccessReadLong(dev##num, (offset))
#else
#define READ_LONG(num, offset) pciReadLong(pciTag(0, 0, num), (offset))
#endif