RTP 6.0 with Patch A ClockCycles() problem

Looks like ClockCycles() called inside interrupt handler running on pc based
486 board couse memory fault error. Any solution ?

Thanks Janusz.

Interrupt handler is very simple and works until I add ClockCysles() call.

const struct sigevent *
my_interrupt(void* int)
{
ClockCycles();
return(&my_event);
};

my_event is initialized in the thread which attach interrupt handler.

“Janusz” <ruszelj@baxter.com> wrote in message
news:9ptjiu$nc5$1@inn.qnx.com

Looks like ClockCycles() called inside interrupt handler running on pc
based
486 board couse memory fault error. Any solution ?

Interesting. ClockCycles() is inlined, becoming a rdtsc assembly
instruction.
That instruction only exists on Pentium and beyond. The doc says that the
kernel
will emulate the rdtsc instruction if the CPU doesn’t support it. That
emulation
probably doesn’t work from within an interrupt.

That looks like an oversight to me? Let’s see what QNX has to say.

Thanks Janusz.

Interrupt handler is very simple and works until I add ClockCysles() call.

const struct sigevent *
my_interrupt(void* int)
{
ClockCycles();
return(&my_event);
};

my_event is initialized in the thread which attach interrupt handler.

Mario Charest <mcharest@clipzinformatic.com> wrote:

486 board couse memory fault error. Any solution ?

Interesting. ClockCycles() is inlined, becoming a rdtsc assembly
instruction.
That instruction only exists on Pentium and beyond. The doc says that the
kernel
will emulate the rdtsc instruction if the CPU doesn’t support it. That
emulation
probably doesn’t work from within an interrupt.

That looks like an oversight to me? Let’s see what QNX has to say.

It seems the wrong set of inline assembly is being inlined, (ie. if it’s not a
pentium+ there should be a different set). I’ll take a closer look, and post
back after I explore the issue more in depth.

-Adam

“Operating System for Tech Supp” <os@qnx.com> wrote in message
news:9pvpok$hlq$1@nntp.qnx.com

Mario Charest <> mcharest@clipzinformatic.com> > wrote:

486 board couse memory fault error. Any solution ?

Interesting. ClockCycles() is inlined, becoming a rdtsc assembly
instruction.
That instruction only exists on Pentium and beyond. The doc says that
the
kernel
will emulate the rdtsc instruction if the CPU doesn’t support it. That
emulation
probably doesn’t work from within an interrupt.

That looks like an oversight to me? Let’s see what QNX has to say.

It seems the wrong set of inline assembly is being inlined, (ie. if it’s
not a
pentium+ there should be a different set).

gcc has option to control what CPU it’s being compile for, but I don’t
think this is where the solution lies.

Historicly programs compiled for Pentium work on 386.

I’ll take a closer look, and post back after I explore the issue more in
depth.

-Adam

Mario Charest <mcharest@clipzinformatic.com> wrote:

gcc has option to control what CPU it’s being compile for, but I don’t
think this is where the solution lies.
Historicly programs compiled for Pentium work on 386.

Correct - I wasn’t trying to imply that was the solution, and I hope
I didn’t lead anyone astray (more of a brain storm). I’m looking into
it.

-Adam

Operating System for Tech Supp <os@qnx.com> wrote:

Mario Charest <> mcharest@clipzinformatic.com> > wrote:

gcc has option to control what CPU it’s being compile for, but I don’t
think this is where the solution lies.
Historicly programs compiled for Pentium work on 386.

Correct - I wasn’t trying to imply that was the solution, and I hope
I didn’t lead anyone astray (more of a brain storm). I’m looking into
it.

There is an issue with the rdtsc emualtion when in an interrupt handler (only
on x86). I’ll put it on the bug list for the furture release.

-Adam

Thank you Adam.
-Janusz.

“Operating System for Tech Supp” <os@qnx.com> wrote in message
news:9q26n0$3ac$1@nntp.qnx.com
Operating System for Tech Supp <os@qnx.com> wrote:

Mario Charest <> mcharest@clipzinformatic.com> > wrote:

gcc has option to control what CPU it’s being compile for, but I don’t
think this is where the solution lies.
Historicly programs compiled for Pentium work on 386.

Correct - I wasn’t trying to imply that was the solution, and I hope
I didn’t lead anyone astray (more of a brain storm). I’m looking into
it.

There is an issue with the rdtsc emualtion when in an interrupt handler
(only
on x86). I’ll put it on the bug list for the furture release.

-Adam