[asterisk-dev] Re: ztdummy question

Tony Mountifield tony at softins.clara.co.uk
Sat Jan 21 07:34:48 MST 2006


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.

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.

> Is there a better check for the timer interface at CPP time other than
> the kernel version? Any specific CONFIG_ macro to check for? CONFIG_RTC?
> CONFIG_GEN_RTC? 

I'm not sure whether the CONFIG macros are available to be tested against
at the time of compiling ztdummy. USE_RTC is only compatible with 
CONFIG_RTC=y or CONFIG_RTC=m, not with CONFIG_GEN_RTC.

But CONFIG_GEN_RTC is really intended for non-PC architectures.

> Is it possible that an x86 PC will not support RTC even if there is
> kernel-level support?
> 
> What about other architectures? amd64 comes to mind as an archtecture
> that works with a somewhat similar hardware.

I don't know, I'm afraid. I suppose an embedded x86 non-pc might not
have the 146818 RTC chip. I believe any machine designed as a standard
PC architecture would have it.

Cheers
Tony
-- 
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org



More information about the asterisk-dev mailing list