For any of the times that softirq's execute, a function do_softirq() is called and the following code executes.
unsigned int pending; pending = local_softirq_pending(); if ( pending ) { struct softirq_action *h; /* clear the pending mask */ set_softirq_pending(0); h = softirq_vec; do { if ( pending & 1 ) { h->action(h); } h++; pending >>= 1; } while( pending ); }
- interrupts are disabled around geting a copying of the pending mask and clearing the mask!
- loop terminates ok because pending is 32 bits, there are 32 entries in the softirq_vec, and 32 (logical) right shifts will make pending be 0.