[Linux1394-cvslog] rev 813 - trunk
Brought to you by:
aeb,
bencollins
From: SVN U. <ben...@li...> - 2003-03-05 16:04:44
|
Author: bencollins Date: 2003-03-05 11:04:02 -0500 (Wed, 05 Mar 2003) New Revision: 813 Modified: trunk/ieee1394_transactions.c trunk/ieee1394_types.h trunk/nodemgr.c Log: The bitops always operate on unsigned long, and not on u64 as used by the ieee1394 code. Use the *_BITMAP to always get a 64bit array of ulongs. -- Christoph Hellwig Modified: trunk/ieee1394_transactions.c ============================================================================== --- trunk/ieee1394_transactions.c (original) +++ trunk/ieee1394_transactions.c 2003-03-05 11:04:04.000000000 -0500 @@ -146,10 +146,10 @@ spin_lock_irqsave(&tp->lock, flags); - packet->tlabel = find_next_zero_bit(&tp->pool, 64, tp->next); + packet->tlabel = find_next_zero_bit(tp->pool, 64, tp->next); tp->next = (packet->tlabel + 1) % 64; /* Should _never_ happen */ - BUG_ON(test_and_set_bit(packet->tlabel, &tp->pool)); + BUG_ON(test_and_set_bit(packet->tlabel, tp->pool)); tp->allocations++; spin_unlock_irqrestore(&tp->lock, flags); @@ -177,7 +177,7 @@ BUG_ON(packet->tlabel > 63 || packet->tlabel < 0); spin_lock_irqsave(&tp->lock, flags); - BUG_ON(!test_and_clear_bit(packet->tlabel, &tp->pool)); + BUG_ON(!test_and_clear_bit(packet->tlabel, tp->pool)); spin_unlock_irqrestore(&tp->lock, flags); up(&tp->count); Modified: trunk/nodemgr.c ============================================================================== --- trunk/nodemgr.c (original) +++ trunk/nodemgr.c 2003-03-05 11:04:04.000000000 -0500 @@ -131,7 +131,10 @@ spin_lock_irqsave(&ne->tpool->lock, flags); PUTF(" Free : %d\n", atomic_read(&ne->tpool->count.count) + 1); PUTF(" Total : %u\n", ne->tpool->allocations); - PUTF(" Mask : %016Lx\n", (unsigned long long)ne->tpool->pool); + PUTF(" Mask0 : %0lx\n", ne->tpool->pool[0]); +#if (BITS_PER_LONG <= 32) + PUTF(" Mask1 : %0lx\n", ne->tpool->pool[1]); +#endif spin_unlock_irqrestore(&ne->tpool->lock, flags); PUTF(" Bus Options :\n"); PUTF(" IRMC(%d) CMC(%d) ISC(%d) BMC(%d) PMC(%d) GEN(%d)\n" Modified: trunk/ieee1394_types.h ============================================================================== --- trunk/ieee1394_types.h (original) +++ trunk/ieee1394_types.h 2003-03-05 11:04:04.000000000 -0500 @@ -72,19 +72,20 @@ /* Transaction Label handling */ struct hpsb_tlabel_pool { - u64 pool; + DECLARE_BITMAP(pool, 64); spinlock_t lock; u8 next; u32 allocations; struct semaphore count; }; -#define HPSB_TPOOL_INIT(_tp) \ -do { \ - sema_init(&(_tp)->count, 63); \ - spin_lock_init(&(_tp)->lock); \ - (_tp)->next = 0; \ - (_tp)->pool = 0; \ +#define HPSB_TPOOL_INIT(_tp) \ +do { \ + CLEAR_BITMAP((_tp)->pool, 64); \ + spin_lock_init(&(_tp)->lock); \ + (_tp)->next = 0; \ + (_tp)->allocations = 0; \ + sema_init(&(_tp)->count, 63); \ } while(0) |