>From 3ddf6990eedb83e06d218ba32a9ce1db2f2d50f8 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 9 May 2008 15:23:14 -0700 Subject: [PATCH] Fix pciaccess READ_LONG to work with Sun compilers Sun compilers don't allow nesting {} inside () apparently --- src/nv_hw.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/nv_hw.c b/src/nv_hw.c index 0e74e4d..5fbcac9 100644 --- a/src/nv_hw.c +++ b/src/nv_hw.c @@ -669,6 +669,15 @@ static void nv30UpdateArbitrationSetting *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, @@ -682,8 +691,7 @@ #if XSERVER_LIBPCIACCESS 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 -- 1.4.1