From 3c4af3a1c3e762dac03b047d2fce3e1019805998 Mon Sep 17 00:00:00 2001 From: kpfleming Date: Wed, 31 Aug 2005 21:41:37 +0000 Subject: make spinlock definitions compatible with -RT kernel patches (and future syntax in mainline kernel, probably) (issue #5080) git-svn-id: http://svn.digium.com/svn/zaptel/trunk@751 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- tor2.c | 4 ++++ torisa.c | 4 ++++ zaptel.c | 11 ++++++++++- ztd-eth.c | 5 ++++- ztd-loc.c | 4 ++++ ztdummy.c | 4 ++++ ztdynamic.c | 6 ++++-- 7 files changed, 34 insertions(+), 4 deletions(-) diff --git a/tor2.c b/tor2.c index e7b3a2a..51d7452 100755 --- a/tor2.c +++ b/tor2.c @@ -1106,7 +1106,11 @@ static void tor2_tasklet(unsigned long data) 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) { diff --git a/torisa.c b/torisa.c index 53b49fc..5bee0ed 100755 --- a/torisa.c +++ b/torisa.c @@ -130,7 +130,11 @@ static int prefmaster = 0; 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]; diff --git a/zaptel.c b/zaptel.c index da898c6..c35fed9 100755 --- a/zaptel.c +++ b/zaptel.c @@ -329,9 +329,13 @@ static struct zt_timer { 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 @@ u_char __zt_lin2a[16384]; 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]; diff --git a/ztd-eth.c b/ztd-eth.c index f6d3678..c13a32d 100755 --- a/ztd-eth.c +++ b/ztd-eth.c @@ -50,8 +50,11 @@ struct ztdeth_header { /* 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]; diff --git a/ztd-loc.c b/ztd-loc.c index da9ab6c..100bd9f 100755 --- a/ztd-loc.c +++ b/ztd-loc.c @@ -66,7 +66,11 @@ #include #endif +#ifdef DEFINE_SPINLOCK +static DEFINE_SPINLOCK(zlock); +#else static spinlock_t zlock = SPIN_LOCK_UNLOCKED; +#endif static struct ztdlocal { unsigned short key; diff --git a/ztdummy.c b/ztdummy.c index a63fc44..77d2c37 100755 --- a/ztdummy.c +++ b/ztdummy.c @@ -200,7 +200,11 @@ int init_module(void) #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"); diff --git a/ztdynamic.c b/ztdynamic.c index b652ae7..92045e3 100755 --- a/ztdynamic.c +++ b/ztdynamic.c @@ -126,9 +126,11 @@ static struct zt_dynamic_driver *drivers = NULL; 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) { -- cgit v1.2.3