adithyapwav
Newbie level 1
This is my code for interrupt handler:
void abc(unsigned long args)
{
printk("Handler at:%ld", jiffies);
if(i>30)
wake_up_interruptible(&waitqueue);
else
add_timer(&timer_handler);
}
....
init_timer(&timer_handler);
timer_handler.expires=1;
timer_handler.function=abc;
add_timer(&timer_handler);
interruptible_sleep_on(&waitqueue);
......
The problem is that,my timer should expire after every 1 jiffy and handler should be called immediately. But though the timer expires and interrupt is recorded, my handler is not always called immediately. Output:
Handler at : 4913704
Handler at : 4913705
Handler at : 4913709
Handler at : 4913709
Handler at : 4913709
Handler at : 4913709
Handler at : 4913710
Handler at : 4913711
So, The jiffy at 4913706,7,8 and 9 are all handled at 4913709. How can i eliminate this. I want handler called for every jiffy?
Help me plz ...
Thanks in advance
void abc(unsigned long args)
{
printk("Handler at:%ld", jiffies);
if(i>30)
wake_up_interruptible(&waitqueue);
else
add_timer(&timer_handler);
}
....
init_timer(&timer_handler);
timer_handler.expires=1;
timer_handler.function=abc;
add_timer(&timer_handler);
interruptible_sleep_on(&waitqueue);
......
The problem is that,my timer should expire after every 1 jiffy and handler should be called immediately. But though the timer expires and interrupt is recorded, my handler is not always called immediately. Output:
Handler at : 4913704
Handler at : 4913705
Handler at : 4913709
Handler at : 4913709
Handler at : 4913709
Handler at : 4913709
Handler at : 4913710
Handler at : 4913711
So, The jiffy at 4913706,7,8 and 9 are all handled at 4913709. How can i eliminate this. I want handler called for every jiffy?
Help me plz ...
Thanks in advance