Does anyone know where the ClockCyckles() function fetches its return value
on a SH4 platform? Why is this function not concidered interrupt handler
safe (see doc)? Is it possible to get this value in a "safe way" in ISR
(what I need are timestamps)?
Thanks
Martin
ClockCyckles()
Re: ClockCyckles()
Martin Nylund <mnylund@emtrion.de> wrote:
-David
--
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.
Take a look at /usr/include/sh/neutrino.h which implements it.Does anyone know where the ClockCyckles() function fetches its return value
on a SH4 platform?
I think it should be safe, actually.Why is this function not concidered interrupt handler
safe (see doc)? Is it possible to get this value in a "safe way" in ISR
(what I need are timestamps)?
-David
--
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.
Re: ClockCyckles()
David Gibbs <dagibbs@qnx.com> wrote in message
news:brvujo$4no$2@nntp.qnx.com...
counter which can easily be fetched. If emulation is required, you wouldn't
want to take a trap inside an interrupt handler or run emulation code in an
interrupt code path. Take a look at the header, and if your processor
supports the fetch of the counter, it should be safe to call in an ISR
handler.
-Adam
news:brvujo$4no$2@nntp.qnx.com...
It's marked unsafe, since some processors don't provide a real runningMartin Nylund <mnylund@emtrion.de> wrote:
Does anyone know where the ClockCyckles() function fetches its return
value
on a SH4 platform?
Take a look at /usr/include/sh/neutrino.h which implements it.
Why is this function not concidered interrupt handler
safe (see doc)? Is it possible to get this value in a "safe way" in ISR
(what I need are timestamps)?
I think it should be safe, actually.
counter which can easily be fetched. If emulation is required, you wouldn't
want to take a trap inside an interrupt handler or run emulation code in an
interrupt code path. Take a look at the header, and if your processor
supports the fetch of the counter, it should be safe to call in an ISR
handler.
-Adam
Re: ClockCyckles()
"Adam Mallory" <amallory@qnx.com> schrieb im Newsbeitrag
news:bs0m8q$sci$1@nntp.qnx.com...
-Martin
news:bs0m8q$sci$1@nntp.qnx.com...
for your help.David Gibbs <dagibbs@qnx.com> wrote in message
news:brvujo$4no$2@nntp.qnx.com...
Martin Nylund <mnylund@emtrion.de> wrote:
Does anyone know where the ClockCyckles() function fetches its return
value
on a SH4 platform?
Take a look at /usr/include/sh/neutrino.h which implements it.
Why is this function not concidered interrupt handler
safe (see doc)? Is it possible to get this value in a "safe way" in
ISR
(what I need are timestamps)?
I think it should be safe, actually.
It's marked unsafe, since some processors don't provide a real running
counter which can easily be fetched. If emulation is required, you
wouldn't
want to take a trap inside an interrupt handler or run emulation code in
an
interrupt code path. Take a look at the header, and if your processor
supports the fetch of the counter, it should be safe to call in an ISR
handler.
-Adam
The value seems to come direct from the 32bit counter TCNT1 in TMU. Thanks
-Martin
Re: ClockCyckles()
Adam Mallory <amallory@qnx.com> wrote:
safe to use in an interrupt handler, or some idea on how to figure
it out?
(Though, I thought that the instrumented kernel used the same
mechanism for time-stamping events, so it had to be safe to use
in-kernel for all processors, now?)
-David
--
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.
Hm...perhaps the docs should include a note as to when it is/isn'tDavid Gibbs <dagibbs@qnx.com> wrote in message
news:brvujo$4no$2@nntp.qnx.com...
Martin Nylund <mnylund@emtrion.de> wrote:
Does anyone know where the ClockCyckles() function fetches its return
value
on a SH4 platform?
Take a look at /usr/include/sh/neutrino.h which implements it.
Why is this function not concidered interrupt handler
safe (see doc)? Is it possible to get this value in a "safe way" in ISR
(what I need are timestamps)?
I think it should be safe, actually.
It's marked unsafe, since some processors don't provide a real running
counter which can easily be fetched. If emulation is required, you wouldn't
want to take a trap inside an interrupt handler or run emulation code in an
interrupt code path. Take a look at the header, and if your processor
supports the fetch of the counter, it should be safe to call in an ISR
handler.
safe to use in an interrupt handler, or some idea on how to figure
it out?
(Though, I thought that the instrumented kernel used the same
mechanism for time-stamping events, so it had to be safe to use
in-kernel for all processors, now?)
-David
--
QNX Training Services
http://www.qnx.com/support/training/
Please followup in this newsgroup if you have further questions.
Re: ClockCyckles()
David Gibbs <dagibbs@qnx.com> wrote in message
news:btc2e1$1ei$3@nntp.qnx.com...
unwise to take a trap or do emulation (or both in case the emulation is
implemented via a trap) during ISR time.
-Adam
news:btc2e1$1ei$3@nntp.qnx.com...
Yes, I would say that it should be at least mentioned.Hm...perhaps the docs should include a note as to when it is/isn't
safe to use in an interrupt handler, or some idea on how to figure
it out?
Yes, I should be a little more clear. It should be safe, but it could be(Though, I thought that the instrumented kernel used the same
mechanism for time-stamping events, so it had to be safe to use
in-kernel for all processors, now?)
unwise to take a trap or do emulation (or both in case the emulation is
implemented via a trap) during ISR time.
-Adam