[asterisk-dev] Re: ztdummy question
Sean Cook
scook at kinex.net
Sat Jan 21 11:25:30 MST 2006
On Sat, 2006-01-21 at 16:31 +0000, Tony Mountifield wrote:
> In article <20060121144940.GH16880 at xorcom.com>,
> Tzafrir Cohen <tzafrir.cohen at xorcom.com> wrote:
> > On Sat, Jan 21, 2006 at 02:34:48PM +0000, Tony Mountifield wrote:
> > > In article <20060121123848.GF16880 at xorcom.com>,
> > > Tzafrir Cohen <tzafrir.cohen at xorcom.com> wrote:
> > > > On Sat, Jan 21, 2006 at 10:14:44AM +0000, Tony Mountifield wrote:
> > > > > In article <43D14D89.8010506 at kinex.net>, Sean Cook <scook at kinex.net> wrote:
> > > > > >
> > > > > > with the changes to the ztdummy to rely on rtc vs jiffies, I am now
> > > > > > forced to increase the interrupt frequency time by roughly 10x the
> > > > > > frequency recommended for the SMP processing systems.
> > > > > >
> > > > > > Is this wise? Or would it be better to not assume that the CONFIG_HZ ==
> > > > > > 1000 and base the calculation on what ever HZ is set to?
> > > > >
> > > > > You should make sure that USE_RTC is defined, and then you WON'T depend
> > > > > on the value of HZ in the kernel, because the interrupts will be generated
> > > > > by the RTC chip and not hooked into the kernel jiffy clock.
> > > >
> > > > What reason is there not to set USE_RTC, assuming my kernel provides the
> > > > necessary timer interface?
> > >
> > > In my opinion, no reason at all. The only reason USE_RTC is inside a #if 0
> > > for 2.6 kernels before 2.6.13 is because when the patch was originally
> > > committed, the committer updated ztdummy.c but forgot to do ztdummy.h.
> > > (I don't know why - they were both in the patch file I submitted). This
> > > resulted in some vocal complaints of compilation errors, and the #if 0 was
> > > put in as a knee-jerk fix before understanding the true reasons for the
> > > errors. See the history on bug #4301.
> >
> > The following is from zaptel 1.2.1, I believe:
> >
> > #if defined(__i386__)
> > #if LINUX_VERSION_CODE >= VERSION_CODE(2,6,13)
> > #define USE_RTC
> > #else
> > #if 0
> > #define USE_RTC
> > #endif
> > #endif
> > #endif
>
> Yes, it's been like that since before 1.2 was released.
>
> > [...snip...]
> > >
> > > It's a great pity the #if 0 is still there as the default in zaptel-1.2,
> > > but I got fed up campaigning for it.
> >
> > So, should the above condition be "kernel version >= 2.6.13 [or
> > maybe a lower version] && CONFIG_RTC being set?
> >
> > I figure that the code there is 2.6-specific anyway.
>
> Yes, in my opinion it should be:
>
> #if defined(__i386__) && defined(LINUX26)
> #define USE_RTC
> #endif
>
Don't forget x86_64 :)
> Period.
>
> I still don't know how the zaptel compilation could check CONFIG_RTC.
> In any case, some kernels have CONFIG_RTC=m and CONFIG_GEN_RTC=m.
> That doesn't tell the compilation anything about which of the two modules
> is going to be loaded.
>
what about something as simple as /dev/rtc?
More information about the asterisk-dev
mailing list