本文共 572 字,大约阅读时间需要 1 分钟。
void __tasklet_schedule(struct tasklet_struct *t)数的主要作用是将参数t代表的软中断 添加到向量tasklet_vec的尾部,并触发一个软中断void __tasklet_schedule(struct tasklet_struct *t){ unsigned long flags; #禁止本地中断 local_irq_save(flags); #由于t要被加入tasklet_vec的尾部,因此t->next要被置null t->next = NULL; #将t添加到tasklet_vec.tail的尾部 *__this_cpu_read(tasklet_vec.tail) = t; __this_cpu_write(tasklet_vec.tail, &(t->next)); #触发软件中断 raise_softirq_irqoff(TASKLET_SOFTIRQ); #使能本地中断 local_irq_restore(flags);}这里的tasklet_vec是一个percpu变量.其定义如下:从禁止本地中断也可以推出来tasklet_vec 应该是一个本地变量static DEFINE_PER_CPU(struct tasklet_head, tasklet_vec);
转载地址:http://frjmi.baihongyu.com/