Is ClockCycle() safe in ISR in Pentium or Celeron or AMD CPU

I have programmed an interrupt handle program in Pentium III866 cpu (QNX 6.1.0+PatchA).
In the interrupt handle function ,I use the ClockCycles() function to get
count(something relate to the time),it works ok(no crash).it seems safe to
use in interrupt handler in Pentium CPU .

  1. I search the docs on qnx web about ClockCycles() for qnx6.1.0,it says
    that the function is safety in interrupt handler.
    And it says that it depends on the cpu style—“x86 has the RDTSC

    Now we will select new computer which has “CPU Celeron 800” to running the same program(interrupt program).I don’t know whether it is safe to use ClockCycles() in interrupt handler on that cpu style,if I still use
    Qnx6.1.0+PatchA. By the way, if the cpu is AMD ,is it safe to to use ClockCycles() in interrupt handler?

  2. In Qnx6.2.1 online help,it said that the function ClockCycles() is not
    safe in interrupt handler.
    If I use the new system Qnx6.2.x ,it seems that we can’t use the
    ClockCycles() in interrupt handler. Does it really not safe to use
    ClockCycles() in interrupt handler on Pentium or Celeron or AMD cpu?

  3. If I can’t use ClockCycles() in interrupt handler,how to program to get
    the current time of the interrupt in interrupt handler?
    Somebody says that it can use “syspage” about time to record the system time .But I don’t know how?

Any advice.

I can’t think why this would not be safe. Even for CPUs that don’t have a free running counter the docs say the kernel implements a coarse equivalent, “For processors that don’t implement such an instruction in hardware (e.g. a 386), the kernel emulates one.”

I’ve happily used it in an ISR under all versions of QNX 6. I think the safety status is wrong.

evanh says

What style CPU do you use? Pentium ,Pentium Pro ,PII ,PIII or PIV or Celeron or AMD?
Have you ever really tried it on Celeron CPU?

Evanh, on 486 it will crash. Celeron are ok since they are all Pentium class CPU.

I vaguely remember something about QSS trying to get the emulation to work from within an interrupt. I don’t remember if it was done or not.

On our computers (P4), ClockCycles() crashes everytime in an interrupt handler. I tried using the RDTSC instruction, but it crashes like ClockCycles(). Why??
I try to use ‘nanospin()’ to wait for a precise delay, but it is not reliable nor very precise. I initialize it (nanospin_calibrate(1)) before the first use.

We use QNX 6.2.1.
Has anyone an idea for a reliable busy-wait function?