diff options
author | kpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2005-08-31 21:41:37 +0000 |
---|---|---|
committer | kpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2005-08-31 21:41:37 +0000 |
commit | 3c4af3a1c3e762dac03b047d2fce3e1019805998 (patch) | |
tree | cf30b12e5c0f5c0c2b1be69501444c2b2350a507 | |
parent | 8eb9513a5d348fcb85cd4438d2152f5a18c646b4 (diff) |
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
-rwxr-xr-x | tor2.c | 4 | ||||
-rwxr-xr-x | torisa.c | 4 | ||||
-rwxr-xr-x | zaptel.c | 11 | ||||
-rwxr-xr-x | ztd-eth.c | 5 | ||||
-rwxr-xr-x | ztd-loc.c | 4 | ||||
-rwxr-xr-x | ztdummy.c | 4 | ||||
-rwxr-xr-x | ztdynamic.c | 6 |
7 files changed, 34 insertions, 4 deletions
@@ -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) { @@ -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]; @@ -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]; @@ -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]; @@ -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; @@ -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) { |