Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - 3 questions, 1 about timers, 1 about multi-core and one about timer_timeout: (9 Items)
   
3 questions, 1 about timers, 1 about multi-core and one about timer_timeout  
Hi all,

I have 3 specific questions and I hope I ask them in the proper forum.

1) Is the Intel HPET supported in QNX ? Or will it be?
2) Why do you need to specify a timeout in nanoseconds in TimerTimeout when the timeout occurs on a 'tick'?
3) When working with multi-core, you can use ThreadCtl(_NTO_TCTL_RUNMASK) to set the runmask for a certain thread. You 
can do this at the begin of a thread. This might look inefficient. Another way to prevent this is the solution given in 
http://qssl.com/developers/docs/6.3.0SP3/multicore_en/user_guide/how_to.html?printable=1#IMPACT . Wouldn't it be nicer 
to do this somewhere in the pthread_attr_t? This might make your code more readable. What if you want to assign specific
 threads to specific CPU's, and I don't want to use the ThreadCtl(_NTO_TCTL_RUNMASK) approach at the beginning of the 
thread, how do I use the  inherit mask then. Do I need to change it after each thread creation?

Regards,
Freddy
Re: 3 questions, 1 about timers, 1 about multi-core and one about tim er_timeout  
Hi Freddy,

Freddy Martens wrote:
>
> Hi all,
>
> I have 3 specific questions and I hope I ask them in the proper forum.
>
> 1) Is the Intel HPET supported in QNX ? Or will it be?
>
Not at this time.  We don't have any plans yet to support it.
>
> 2) Why do you need to specify a timeout in nanoseconds in TimerTimeout 
> when the timeout occurs on a 'tick'?
>
Because the system time is kept in nanoseconds - it just so happens that 
it goes up in increments in SYSPAGE_ENTRY(qtime)->nsec_incr per tick.
If you changed the tick time then something based on 'ticks' would 
become invalid.
>
> 3) When working with multi-core, you can use 
> ThreadCtl(_NTO_TCTL_RUNMASK) to set the runmask for a certain thread. 
> You can do this at the begin of a thread. This might look inefficient. 
> Another way to prevent this is the solution given in 
> http://qssl.com/developers/docs/6.3.0SP3/multicore_en/user_guide/how_to.html?printable=1#IMPACT 
> . Wouldn't it be nicer to do this somewhere in the pthread_attr_t? 
> This might make your code more readable. What if you want to assign 
> specific threads to specific CPU's, and I don't want to use the 
> ThreadCtl(_NTO_TCTL_RUNMASK) approach at the beginning of the thread, 
> how do I use the  inherit mask then. Do I need to change it after each 
> thread creation?
>
In 6.3.2 you can set an inheritance mask such that any threads created 
inherit the runmask of their parent.

Regards,

Colin
>
> Regards,
> Freddy
>
>
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post3104
>

-- 
cburgess@qnx.com

Re: 3 questions, 1 about timers, 1 about multi-core and one about tim er_timeout  
On Thu, Nov 29, 2007 at 02:12:12PM -0500, Colin Burgess wrote:
> > 1) Is the Intel HPET supported in QNX ? Or will it be?
> >
> Not at this time.  We don't have any plans yet to support it.

There's nothing in the operating system proper that needs to change for
this BTW, it's purely a board support package issue.

-- 
Brian Stecher (bstecher@qnx.com)        QNX Software Systems
phone: +1 (613) 591-0931 (voice)        175 Terence Matthews Cr.
       +1 (613) 591-3579 (fax)          Kanata, Ontario, Canada K2M 1W8
Re: 3 questions, 1 about timers, 1 about multi-core and one about tim er_timeout  
Hi Colin and Brian,

Thanks for your answers, but I want to confirm 2 things:
1) HPET, I still can write an application for X86 enabling the HPET right? This does not have to be in the x86 BSP right
?

3) The inherit mask, are you referring to the example given in the URL I mentioned ?

Regards,
Freddy Martens
Re: 3 questions, 1 about timers, 1 about multi-core and one about tim er_timeout  
On Fri, Nov 30, 2007 at 01:30:24AM -0500, Freddy Martens wrote:
> Thanks for your answers, but I want to confirm 2 things:
> 1) HPET, I still can write an application for X86 enabling the HPET
> right? This does not have to be in the x86 BSP right?

I didn't take a close enough read of the spec to see exactly how the
interrupts were being delivered to the CPU to say for sure. If interrupts
are being directed through the old, legacy style 8259 interrupt structure
than no, you don't need to do anything - just InterruptAttach[Event]()
to the proper number and off you go.

If you need to use the new APIC style of interrupts (or something else), 
then you need to add some more interrupt callout routines to the startup
code (switching startup-bios to use APIC interrupts is one of those things
that we'd like to do, but there just never seems to be time to get around 
to it).

> 3) The inherit mask, are you referring to the example given in the URL I
> mentioned ?

Yup.

-- 
Brian Stecher (bstecher@qnx.com)        QNX Software Systems
phone: +1 (613) 591-0931 (voice)        175 Terence Matthews Cr.
       +1 (613) 591-3579 (fax)          Kanata, Ontario, Canada K2M 1W8
Re: 3 questions, 1 about timers, 1 about multi-core and one about tim er_timeout  
Brian,

I can implement it in the startup but I could also write a separate application that routes the interrupt to a free 
interrupt (IRQ7) and then use the HPET as a fast timer right ?

I would be more comfortable by doing this in a separate application using a different IRQ when using it as a high speed 
timer only.

Regards,
Freddy
Re: 3 questions, 1 about timers, 1 about multi-core and one about tim er_timeout  
On Sun, Dec 02, 2007 at 11:16:42AM -0500, Freddy Martens wrote:
> I can implement it in the startup but I could also write a separate
> application that routes the interrupt to a free interrupt (IRQ7) and
> then use the HPET as a fast timer right ?

If I'm reading the spec right, you need to implement the IOAPIC interrupt
callouts in startup to use it.

-- 
Brian Stecher (bstecher@qnx.com)        QNX Software Systems
phone: +1 (613) 591-0931 (voice)        175 Terence Matthews Cr.
       +1 (613) 591-3579 (fax)          Kanata, Ontario, Canada K2M 1W8
Re: 3 questions, 1 about timers, 1 about multi-core and one about tim er_timeout  
> On Fri, Nov 30, 2007 at 01:30:24AM -0500, Freddy Martens wrote:

> If you need to use the new APIC style of interrupts (or something else), 
> then you need to add some more interrupt callout routines to the startup
> code (switching startup-bios to use APIC interrupts is one of those things
> that we'd like to do, but there just never seems to be time to get around 
> to it).

Since 2007 was there any progress made in that regard.

> 
> -- 
> Brian Stecher (bstecher@qnx.com)        QNX Software Systems
> phone: +1 (613) 591-0931 (voice)        175 Terence Matthews Cr.
>        +1 (613) 591-3579 (fax)          Kanata, Ontario, Canada K2M 1W8


Re: 3 questions, 1 about timers, 1 about multi-core and one about tim er_timeout  
On Tue, Sep 29, 2009 at 01:04:39PM -0400, Mario Charest wrote:
> > On Fri, Nov 30, 2007 at 01:30:24AM -0500, Freddy Martens wrote:
> 
> > If you need to use the new APIC style of interrupts (or something else), 
> > then you need to add some more interrupt callout routines to the startup
> > code (switching startup-bios to use APIC interrupts is one of those things
> > that we'd like to do, but there just never seems to be time to get around 
> > to it).
> 
> Since 2007 was there any progress made in that regard.

Enough that we've just discovered a problem with the interrupt initialization
code in the kernel that would prevent the io-apic callouts from working
unless some trickery is done. I don't know if the actual callouts will be
in the next release, but the kernel fix certainly will be.

	Brian

-- 
Brian Stecher (bstecher@qnx.com)        QNX Software Systems
phone: +1 (613) 591-0931 (voice)        175 Terence Matthews Cr.
       +1 (613) 591-3579 (fax)          Kanata, Ontario, Canada K2M 1W8