Re: Kernel timers infrastructure

2011-09-12 Thread John Baldwin
On Monday, September 12, 2011 4:42:40 am Filippo Sironi wrote: > This is what I wrote for FreeBSD 7.2 and it does not work: callout_reset() is always going to return false here as you are never rescheduling an existing callout (it is either idle or has already fired each time you invoke callout_

Re: Kernel timers infrastructure

2011-09-12 Thread Filippo Sironi
Thanks a lot guys, it didn't even think about the tty problem... shame on me, I should have read the man pages. :( Filippo ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mai

Re: Kernel timers infrastructure

2011-09-12 Thread Marc Lörner
ot;Marc Lörner" > CC: freebsd-hackers@freebsd.org > Betreff: Re: Kernel timers infrastructure > This is how I modified the module: > > #include > #include > #include > #includ

Re: Re: Kernel timers infrastructure

2011-09-12 Thread Attilio Rao
Besides I'd also suggest to have the callout rearming as the very last step of you callback in order to avoid buffering interleaving issues. Attilio 2011/9/12 Kostik Belousov : > On Mon, Sep 12, 2011 at 11:48:42AM +0200, "Marc L?rner" wrote: >> Hello, >> what about changing order of callout_reset

Re: Re: Kernel timers infrastructure

2011-09-12 Thread Kostik Belousov
On Mon, Sep 12, 2011 at 11:48:42AM +0200, "Marc L?rner" wrote: > Hello, > what about changing order of callout_reset and uprintf? > And your timeout isn't 1minute, it's one second! > > Regards, > Marc > > >I already did that to ensure timer_event_handler would be called correctly. > > > >The resu

Re: Re: Kernel timers infrastructure

2011-09-12 Thread Marc Lörner
Hello, what about changing order of callout_reset and uprintf? And your timeout isn't 1minute, it's one second! Regards, Marc >I already did that to ensure timer_event_handler would be called correctly. > >The result follows: > >freebsd# kldload ./timer.ko >timer_event_handler() with MOD_LOAD >

Re: Kernel timers infrastructure

2011-09-12 Thread Filippo Sironi
This is how I modified the module: #include #include #include #include static struct callout timer_callout; static void timer_function(void *arg) { uprintf("timer_function() begin\n"); if (callout

Re: Kernel timers infrastructure

2011-09-12 Thread Filippo Sironi
I already did that to ensure timer_event_handler would be called correctly. The result follows: freebsd# kldload ./timer.ko timer_event_handler() with MOD_LOAD freebsd# kldunload ./timer.ko timer_event_handler() with MOD_UNLOAD and I maintained the module load for about 1 minute so the timer

Re: Kernel timers infrastructure

2011-09-12 Thread Adrian Chadd
How about adding some printfs() to the functions to ensure they're being called? Adrian ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...

Re: Kernel timers infrastructure

2011-09-12 Thread Filippo Sironi
This is what I wrote for FreeBSD 7.2 and it does not work: #include #include #include #include static struct callout timer_callout; static void timer_function(void *arg) { if (callout_reset(&timer_callout

Re: Kernel timers infrastructure

2011-09-10 Thread Adrian Chadd
On 11 September 2011 09:02, Riccardo Cattaneo wrote: > Of course, the module from which I'm calling them must be already loaded and > initialized, isn't it? > Riccardo Well, yes - but then, you can just add something to the module load code to start off the callout. There are race conditions to

Re: Kernel timers infrastructure

2011-09-10 Thread Riccardo Cattaneo
Of course, the module from which I'm calling them must be already loaded and initialized, isn't it? Riccardo On Sep 11, 2011, at 2:57 AM, Adrian Chadd wrote: > You can use the callout API to schedule timed events in the kernel. > > > > Adrian ___ f

Re: Kernel timers infrastructure

2011-09-10 Thread Adrian Chadd
You can use the callout API to schedule timed events in the kernel. Adrian ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Re: Kernel timers infrastructure

2011-09-10 Thread Riccardo Cattaneo
Hi all, Me in the same situation: university project, freebsd os, required to call a certain function X times/second (say, uprintf). Got no luck till now :( Thanks Riccardo___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/list

Re: Kernel timers infrastructure

2011-07-25 Thread Alexander Motin
Hi. On 25.07.2011 17:13, Filippo Sironi wrote: I'm working on a university project that's based on FreeBSD and I'm currently hacking the kernel... but I'm a complete newbie. My question is: what if I have to call a certain function 10 times per second? I've seen a bit of code regarding callout_

Re: Kernel timers infrastructure

2011-07-25 Thread Robert Watson
On Mon, 25 Jul 2011, Filippo Sironi wrote: I'm working on a university project that's based on FreeBSD and I'm currently hacking the kernel... but I'm a complete newbie. My question is: what if I have to call a certain function 10 times per second? I've seen a bit of code regarding callout_*

Kernel timers infrastructure

2011-07-25 Thread Filippo Sironi
Hi everyone, I'm working on a university project that's based on FreeBSD and I'm currently hacking the kernel... but I'm a complete newbie. My question is: what if I have to call a certain function 10 times per second? I've seen a bit of code regarding callout_* functions but I can't get through