Dennis Kellly
|
Re: ClockCycles() use in interrupt handlers
|
Dennis Kellly
03/17/2008 8:52 AM
post5854
|
Re: ClockCycles() use in interrupt handlers
>>>The documentation is wrong.
Thanks. It would be good if we get the docs fixed for 6.4.
|
|
|
Michael Tasche
|
Re: ClockCycles() use in interrupt handlers
|
Michael Tasche
04/08/2008 2:29 AM
post6513
|
Re: ClockCycles() use in interrupt handlers
Hi,
> The documentation is wrong. ClockCyles() is safe to use in all environments
since when?
I remember, that "rdtsc" instructions were emulated on 386/486 cpu's by "wrong opcode exceptions" using the PIT. This
did "not" work in ISR's.
If this has been changed, can someone tell me the 1st QNX Version, which can use ClockCycles in ISR's on 386/486?
-Michael
> on all architectures. The kernel instrumentation wouldn't work if that
> wasn't true.
>
> On Mon, Mar 17, 2008 at 05:43:34AM -0400, Thomas Haupt wrote:
> > Looking at the implementations in
> > /usr/include/<platform>/neutrino.h
> > it looks like there are interrupt-safe implementations of ClockCycles()
> > for all platforms except for the ARM (i.e., mips, ppc, sh, and x86).
> >
> > I guess a function is listed as "unsafe" as long as we cannot guarantee
> > that the implementation will be [interrupt]-safe on /all/ platforms...
> >
> > Oh, and the bit about re-enabling interrupts would only be true for
> > kernel calls -- and those exactly you must avoid by all means in an
> > interrupt handler (the handler was itself invoked by the kernel; doing
> > a kernel-call would introduce a reentrancy we cannot handle at that
> > point). The inline-assembly-implementations of ClockCycles on non-arm-
> > platforms all just read some special CPU registers and maybe do a tiny
> > bit of calculation; so there's no need to call kernel there.
> >
> > Hope this helps,
> > - Thomas
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Dennis Kelly
> > > Gesendet: 14 March 2008 16:44
> > > An: ostech-core_os
> > > Betreff: ClockCycles() use in interrupt handlers
> > >
> > >
> > > ClockCycles() is listed in docs as "unsafe" to call from an
> > > interrupt handler. However, for interrupt latency tests,
> > > there seems to be no "safe" call for a precise timestamp.
> > >
> > > Also release notes for 6.2.1B list "Execution of
> > > ClockCycles() inside an interrupt causes kernel crash (Ref#
> > > 14369)" as having been fixed, i.e. it must have been a valid use case.
> > >
> > > Why is it listed as unsafe? Does it re-enable interrupts on exit?
> > >
> > > Thanks.
> > >
> > >
> > >
> > > _______________________________________________
> > > OSTech
> > > http://community.qnx.com/sf/go/post5816
> > >
> >
> > _______________________________________________
> > OSTech
> > http://community.qnx.com/sf/go/post5850
>
> --
> 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
|
|
|