I took over some 'legacy' code from another project and saw where the guy had counted out his cycles and then calculated back from that for timing on the interrupt. I could never understand why, but then realized the problem he was fighting.
Problem is, when your ISR has a variable time in the interrupt.
I always do my EOI processing at the start of the handler, then put a check to see if it's reentrant.
Would doing that always guarantee that you are inside the window where the time in the interrupt would add to the interrupt time? Or would it at least always give you a guaranteed fixed time for your interrupt to next interrupt? Inquiring minds want to know!
Actually, in my case, I don't treat any RTI as an accurate timer, I always use it as at most a housekeeping timer to clean some things up. If I need an accurate timer, I always use one of the timer channels with a compare and always program the 'next match' so that it's independant of what else is going on. That way even if the int is held off by another routine disabling the int, it will always stay 'on track' with true time.
Mike