TCPIP(1)

asmlinkage void do_bottom_half(void)
{
unsigned long active;
unsigned long mask,left;
struct bh_struct *bh;


bh = bh_base;
active = bh_active & bh_mask;
/*mask走势为:0001,0010,0100...
left走势为   :1111,1110,1100...
算法实现动态左移,只
比较没有比较过得位(同左移一个道理)*/
for(mask =1,left = ~0;left & active ; bh++,mask +=mask,left +=left)
{
if(mask & active)
{
void (*fn)(void*);
bh_active & = ~mask;
fn = bh->routine;
if(!fn)
goto bad_bh;
fn(bh->data);
}
}


return;
bad_bh:
printk("irq.c:bad bottom half entry %081x\n",mask);
}

你可能感兴趣的:(TCPIP(1))