[svn-commits] fjoe: freebsd/trunk r9139 - in /freebsd/trunk: drivers/dahdi/ drivers/dahdi/w...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun Aug 15 11:32:31 CDT 2010


Author: fjoe
Date: Sun Aug 15 11:32:25 2010
New Revision: 9139

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9139
Log:
Fix build on sparc64.

Modified:
    freebsd/trunk/drivers/dahdi/dahdi-base.c
    freebsd/trunk/drivers/dahdi/dahdi_dynamic.c
    freebsd/trunk/drivers/dahdi/wcb4xxp/base.c
    freebsd/trunk/drivers/dahdi/wcfxo.c
    freebsd/trunk/drivers/dahdi/wct4xxp/base.c
    freebsd/trunk/drivers/dahdi/wctdm.c
    freebsd/trunk/drivers/dahdi/wcte11xp.c
    freebsd/trunk/include/dahdi/compat/bsd.h
    freebsd/trunk/include/dahdi/kernel.h

Modified: freebsd/trunk/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi-base.c?view=diff&rev=9139&r1=9138&r2=9139
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi-base.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi-base.c Sun Aug 15 11:32:25 2010
@@ -6473,7 +6473,7 @@
 */
 
 #define ZEROTRAP    /* turn on the trap as per the MIL-STD */
-#define BIAS 0x84   /* define the add-in bias for 16 bit samples */
+#define DAHDI_BIAS 0x84   /* define the add-in bias for 16 bit samples */
 #define CLIP 32635
 
 #ifdef CONFIG_CALC_XLAW
@@ -6508,7 +6508,7 @@
   if (sample > CLIP) sample = CLIP;             /* clip the magnitude */
 
   /* Convert from 16 bit linear to ulaw. */
-  sample = sample + BIAS;
+  sample = sample + DAHDI_BIAS;
   exponent = exp_lut[(sample >> 7) & 0xFF];
   mantissa = (sample >> (exponent + 3)) & 0x0F;
   ulawbyte = ~(sign | (exponent << 4) | mantissa);

Modified: freebsd/trunk/drivers/dahdi/dahdi_dynamic.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/dahdi_dynamic.c?view=diff&rev=9139&r1=9138&r2=9139
==============================================================================
--- freebsd/trunk/drivers/dahdi/dahdi_dynamic.c (original)
+++ freebsd/trunk/drivers/dahdi/dahdi_dynamic.c Sun Aug 15 11:32:25 2010
@@ -367,8 +367,8 @@
 
 	list_for_each_entry_rcu(drv, &driver_list, list) {
 		/* Flush any traffic still pending in the driver */
-		if (drv->flush) {
-			drv->flush();
+		if (drv->dynamic_flush) {
+			drv->dynamic_flush();
 		}
 	}
 	rcu_read_unlock();

Modified: freebsd/trunk/drivers/dahdi/wcb4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wcb4xxp/base.c?view=diff&rev=9139&r1=9138&r2=9139
==============================================================================
--- freebsd/trunk/drivers/dahdi/wcb4xxp/base.c (original)
+++ freebsd/trunk/drivers/dahdi/wcb4xxp/base.c Sun Aug 15 11:32:25 2010
@@ -24,6 +24,7 @@
 #include <sys/types.h>
 #include <sys/bus.h>
 #include <sys/module.h>
+#include <sys/param.h>
 #include <sys/queue.h>
 #include <sys/rman.h>
 #include <sys/systm.h>

Modified: freebsd/trunk/drivers/dahdi/wcfxo.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wcfxo.c?view=diff&rev=9139&r1=9138&r2=9139
==============================================================================
--- freebsd/trunk/drivers/dahdi/wcfxo.c (original)
+++ freebsd/trunk/drivers/dahdi/wcfxo.c Sun Aug 15 11:32:25 2010
@@ -27,6 +27,7 @@
 #include <sys/types.h>
 #include <sys/bus.h>
 #include <sys/module.h>
+#include <sys/param.h> 
 #include <sys/rman.h>
 
 #include <machine/bus.h>

Modified: freebsd/trunk/drivers/dahdi/wct4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wct4xxp/base.c?view=diff&rev=9139&r1=9138&r2=9139
==============================================================================
--- freebsd/trunk/drivers/dahdi/wct4xxp/base.c (original)
+++ freebsd/trunk/drivers/dahdi/wct4xxp/base.c Sun Aug 15 11:32:25 2010
@@ -32,6 +32,7 @@
 #include <sys/types.h>
 #include <sys/bus.h>
 #include <sys/module.h>
+#include <sys/param.h>
 #include <sys/rman.h>
 #include <sys/systm.h>
 

Modified: freebsd/trunk/drivers/dahdi/wctdm.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wctdm.c?view=diff&rev=9139&r1=9138&r2=9139
==============================================================================
--- freebsd/trunk/drivers/dahdi/wctdm.c (original)
+++ freebsd/trunk/drivers/dahdi/wctdm.c Sun Aug 15 11:32:25 2010
@@ -27,6 +27,7 @@
 #include <sys/types.h>
 #include <sys/bus.h>
 #include <sys/module.h>
+#include <sys/param.h>
 #include <sys/rman.h>
 
 #include <machine/bus.h>

Modified: freebsd/trunk/drivers/dahdi/wcte11xp.c
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/drivers/dahdi/wcte11xp.c?view=diff&rev=9139&r1=9138&r2=9139
==============================================================================
--- freebsd/trunk/drivers/dahdi/wcte11xp.c (original)
+++ freebsd/trunk/drivers/dahdi/wcte11xp.c Sun Aug 15 11:32:25 2010
@@ -27,6 +27,7 @@
 #include <sys/types.h>
 #include <sys/bus.h>
 #include <sys/module.h>
+#include <sys/param.h>
 #include <sys/rman.h>
 
 #include <machine/bus.h>

Modified: freebsd/trunk/include/dahdi/compat/bsd.h
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/include/dahdi/compat/bsd.h?view=diff&rev=9139&r1=9138&r2=9139
==============================================================================
--- freebsd/trunk/include/dahdi/compat/bsd.h (original)
+++ freebsd/trunk/include/dahdi/compat/bsd.h Sun Aug 15 11:32:25 2010
@@ -84,6 +84,7 @@
 #define set_bit(v, p)	atomic_set_long((p), (1 << ((v) & 0x1f)))
 #define clear_bit(v, p)	atomic_clear_long((p), (1 << ((v) & 0x1f)))
 
+#if defined(__i386__) || defined(__x86_64__)
 #define ADDR (*(volatile long *) addr)
 
 #ifdef SMP
@@ -92,7 +93,8 @@
 #define	LOCK_PREFIX ""
 #endif /* SMP */
 
-static __inline int test_and_set_bit(int nr, volatile void * addr)
+static __inline int
+test_and_set_bit(int nr, volatile void *addr)
 {
 	int oldbit;
 
@@ -103,7 +105,8 @@
 	return oldbit;
 }
 
-static __inline__ int test_and_clear_bit(int nr, volatile void * addr)
+static __inline__
+int test_and_clear_bit(int nr, volatile void *addr)
 {
 	int oldbit;
 
@@ -113,6 +116,29 @@
 		:"Ir" (nr) : "memory");
 	return oldbit;
 }
+#else
+static __inline int
+test_and_set_bit(int nr, volatile void *addr)
+{
+	int val;
+
+	do {
+		val = *(volatile int *) addr;
+	} while (atomic_cmpset_int(addr, val, val | (1 << nr)) == 0);
+	return (val & (1 << nr));
+}
+
+static __inline__
+int test_and_clear_bit(int nr, volatile void *addr)
+{
+	int val;
+
+	do {
+		val = *(volatile int *) addr;
+	} while (atomic_cmpset_int(addr, val, val & ~(1 << nr)) == 0);
+	return (val & (1 << nr));
+}
+#endif
 
 /*
  * Atomic API

Modified: freebsd/trunk/include/dahdi/kernel.h
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/include/dahdi/kernel.h?view=diff&rev=9139&r1=9138&r2=9139
==============================================================================
--- freebsd/trunk/include/dahdi/kernel.h (original)
+++ freebsd/trunk/include/dahdi/kernel.h Sun Aug 15 11:32:25 2010
@@ -1009,7 +1009,7 @@
 	int (*transmit)(void *tpipe, unsigned char *msg, int msglen);
 
 	/*! Flush any pending messages */
-	int (*flush)(void);
+	int (*dynamic_flush)(void);
 
 	struct list_head list;
 };




More information about the svn-commits mailing list