[Asterisk-cvs] zaptel tor2.c, 1.25, 1.26 torisa.c, 1.12, 1.13 zaptel.c, 1.112, 1.113 ztd-eth.c, 1.9, 1.10 ztd-loc.c, 1.1, 1.2 ztdummy.c, 1.12, 1.13 ztdynamic.c, 1.12, 1.13

kpfleming kpfleming
Wed Aug 31 17:40:31 CDT 2005


Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/tmp/cvs-serv30563

Modified Files:
	tor2.c torisa.c zaptel.c ztd-eth.c ztd-loc.c ztdummy.c 
	ztdynamic.c 
Log Message:
make spinlock definitions compatible with -RT kernel patches (and future syntax in mainline kernel, probably) (issue #5080)


Index: tor2.c
===================================================================
RCS file: /usr/cvsroot/zaptel/tor2.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- tor2.c	8 Aug 2005 06:43:02 -0000	1.25
+++ tor2.c	31 Aug 2005 21:41:37 -0000	1.26
@@ -1106,7 +1106,11 @@
 static int syncsrc = 0;
 static int syncnum = 0 /* -1 */;
 static int syncspan = 0;
+#ifdef DEFINE_SPINLOCK
+static DEFINE_SPINLOCK(synclock);
+#else
 static spinlock_t synclock = SPIN_LOCK_UNLOCKED;
+#endif
 
 static int tor2_findsync(struct tor2 *tor)
 {

Index: torisa.c
===================================================================
RCS file: /usr/cvsroot/zaptel/torisa.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- torisa.c	15 Jan 2005 22:59:18 -0000	1.12
+++ torisa.c	31 Aug 2005 21:41:37 -0000	1.13
@@ -130,7 +130,11 @@
 
 static int spansstarted = 0;
 
+#ifdef DEFINE_RWLOCK
+static DEFINE_RWLOCK(torisa);
+#else
 static rwlock_t torisa = RW_LOCK_UNLOCKED;
+#endif
 
 static u_char readdata[2][64][ZT_MAX_CHUNKSIZE];
 static u_char writedata[2][64][ZT_MAX_CHUNKSIZE];

Index: zaptel.c
===================================================================
RCS file: /usr/cvsroot/zaptel/zaptel.c,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -d -r1.112 -r1.113
--- zaptel.c	26 Aug 2005 16:40:29 -0000	1.112
+++ zaptel.c	31 Aug 2005 21:41:37 -0000	1.113
@@ -329,9 +329,13 @@
 	wait_queue_head_t sel;
 } *zaptimers = NULL;
 
+#ifdef DEFINE_SPINLOCK
+static DEFINE_SPINLOCK(zaptimerlock);
+static DEFINE_SPINLOCK(bigzaplock);
+#else
 static spinlock_t zaptimerlock = SPIN_LOCK_UNLOCKED;
-
 static spinlock_t bigzaplock = SPIN_LOCK_UNLOCKED;
+#endif
 
 struct zt_zone {
 	char name[40];	/* Informational, only */
@@ -364,8 +368,13 @@
 
 static u_char defgain[256];
 
+#ifdef DEFINE_RWLOCK
+static DEFINE_RWLOCK(zone_lock);
+static DEFINE_RWLOCK(chan_lock);
+#else
 static rwlock_t zone_lock = RW_LOCK_UNLOCKED;
 static rwlock_t chan_lock = RW_LOCK_UNLOCKED;
+#endif
 
 static struct zt_zone *tone_zones[ZT_TONE_ZONE_MAX];
 

Index: ztd-eth.c
===================================================================
RCS file: /usr/cvsroot/zaptel/ztd-eth.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- ztd-eth.c	13 Oct 2004 03:36:01 -0000	1.9
+++ ztd-eth.c	31 Aug 2005 21:41:37 -0000	1.10
@@ -50,8 +50,11 @@
 
 /* We take the raw message, put it in an ethernet frame, and add a
    two byte addressing header at the top for future use */
-
+#ifdef DEFINE_SPINLOCK
+static DEFINE_SPINLOCK(zlock);
+#else
 static spinlock_t zlock = SPIN_LOCK_UNLOCKED;
+#endif
 
 static struct ztdeth {
 	unsigned char addr[ETH_ALEN];

Index: ztd-loc.c
===================================================================
RCS file: /usr/cvsroot/zaptel/ztd-loc.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ztd-loc.c	4 Dec 2004 04:19:41 -0000	1.1
+++ ztd-loc.c	31 Aug 2005 21:41:37 -0000	1.2
@@ -66,7 +66,11 @@
 #include <linux/zaptel.h>
 #endif
 
+#ifdef DEFINE_SPINLOCK
+static DEFINE_SPINLOCK(zlock);
+#else
 static spinlock_t zlock = SPIN_LOCK_UNLOCKED;
+#endif
 
 static struct ztdlocal {
 	unsigned short key;

Index: ztdummy.c
===================================================================
RCS file: /usr/cvsroot/zaptel/ztdummy.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- ztdummy.c	11 Jul 2005 12:44:28 -0000	1.12
+++ ztdummy.c	31 Aug 2005 21:41:37 -0000	1.13
@@ -200,7 +200,11 @@
 #endif
 #else
     int irq;
+#ifdef DEFINE_SPINLOCK
+    DEFINE_SPINLOCK(mylock);
+#else
     spinlock_t mylock = SPIN_LOCK_UNLOCKED;
+#endif
 	
     if (uhci_devices==NULL){
         printk ("ztdummy: Uhci_devices pointer error.\n");

Index: ztdynamic.c
===================================================================
RCS file: /usr/cvsroot/zaptel/ztdynamic.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- ztdynamic.c	8 Aug 2005 14:26:34 -0000	1.12
+++ ztdynamic.c	31 Aug 2005 21:41:37 -0000	1.13
@@ -126,9 +126,11 @@
 static int debug = 0;
 
 static int hasmaster = 0;
-
+#ifdef DEFINE_SPINLOCK
+static DEFINE_SPINLOCK(dlock); 
+#else
 static spinlock_t dlock = SPIN_LOCK_UNLOCKED;
-
+#endif
 
 static void checkmaster(void)
 {




More information about the svn-commits mailing list