"Vladimir Vassilevsky" wrote in message
news:M7qdnUwSuZA5WB_N...@giganews.com...
> While developing embedded systems, many times
> I thought it would be useful to have an additional
> flag for every interrupt. This flag should be set by
> hardware if interrupt request was set again before
> the interrupt was serviced; i.e. an event is missed.
> Do you know of any CPU or interrupt controller that
> already has this functionality?
I remember seeing this on one of the old ('80's era) minicomputers. The
machine used edge, rather than level, triggered interrupts. If a second
edge was seen before the pending interrupt was handled an interrupt overrun
flag was turned on.
From later messages it seems you're trying to debug a possible interrupt
overrun. These things are very dependent on the setup, so it's difficult to
give suggestions. But I'm going to anyway. :)
Maybe this will give you an idea you can apply to your situation.
Note that all I was trying to do was prove it was overrunning. Fixing the
problem, if it was there, would come later.
On interrupt handler entry interrupts were disabled by hardware. And the
interrupting device was constructed such that I could be sure I would not
get another interrupt for a certain number of microseconds. This number of
microseconds, in theory, being long enough that the overall interrupt
handler should never have overrun. I set up a global variable initialized
it to zero on reset. On handler entry, the global variable was examined.
If it was non-zero, an LED was lit and the machine put into a dead loop.
If it was zero, it was incremented, interrupts enabled, and the handler
proceeded normally. Note that originally, interrupts were disabled for the
duration of the handler. When the handler exits, interrupts are disabled,
the global variable decremented, interrupts enabled, and the handler exits.
The handler had a number of paths it could take depending on the data it
retrieved. It was believed, incorrectly, that the data it was possible to
get would never cause execution of more than two of these paths. It turned
out that there were cases where it would actually execute pretty much all of
them. This was due to a documentation error. Some bits, which triggered
some paths, rather than being zero, as the documentation claimed, were
actually intended to be ignored when other bits were or were not set.
Fixing the documentation, and adjusting the code to match, eliminated the
overrun.
- Bill