Plzz do top-posting .......... On 9/15/05, Aggarwal, Vikas (OFT) <Vikas.Aggarwal@xxxxxxxxxxxxxxx> wrote:> > > QmsgSend called in ISR to insert in circular queue & QmsgWait called in ur> tasklet to pick(spin locked operation) from queue. > > Irqreturn_t InterruptServiceRoutine( …………..) > > { > …………. > > /*device handling */ > ………. > > QmsgSend(); > > Return IRQ_HANDLED; > > } > > > #define QUEUE_DEPTH XYZ /* Should depend on ur device */ > > Int queue[QUEUE_DEPTH]; > > Unsigned Q_head, Q_tail, Q_entries; > > #define QmsgSend() \ > > If(Q_entries == QUEUE_DEPTH) \ > > Panic(overflow); \ > > Queue[Q_tail] = "data from the device register"; \ > > Q_tail = (Q_tail + 1) % QUEUE_DEPTH; \ > > Q_entries ++; > > Tasklet_schedule(&isr_tasklet) > > > > #define QmsgWait(x) \ > > Spin_lock_irqsave(&x, flags); \ > > If(!Q_entries){ \ > > Spin_lock_irqsave(&x,flags); break;} \ I think the lock will be a unlock ..... spin_unlock_irqrestore ............ > > "data from device register" = queue[Q_head]; \ > > Q_head = (Q_head + 1 ) % QUEUE_DEPTH ; \ > > Q_entries --; \ > > Spin_unlock_irqsave(&x, flags); > > -- Fawad Lateefÿòž®w¥?ì‰ëÿéiy§!¢Ø^®Wš®v›¢ëm…ââžìdz¹Þ—ð+r¯{øm¶Ÿÿþf¢—ùåþX§»è®äz¹Þ–w°n'¬üPþm§ÿÿ‘êçzYÞÁ¸ž³ú+ƒ÷Ú