Long pulse delivery


I’m creating a piece of s/w which has to react quickly in response to
some external messages from another CPU. My arch is XScale PXA255 @ 200
MHz, Neutrino 6.3. I have attached a pulse interrupt handler (via
AttachInterruptEvent) for a GPIO interrupt, then a thread does a
MsgReveive, reads the message MsgReplies to another thread which waited
for the message.

I measured the times and they don’t look nice. First delay is between
the interrupt occurs and the thread receives a pulse. It takes 50us.
Another huge delay is between calling MsgReply and actually receiving
the reply – another almost 50us. I tried a low level interrupt handler
(InterruptAttach) and the latency was 21us. However it was only for
testing, since I can’t do much in this handler, and it’s still very
long. So I’m stuck with total 100us delay, which is ages for me. Why are
the times so long? 100us is almost 20k CPU instructions, what’s
happening there? And the most important – how can make it closer to 10us?

The whole thing goes like this:

  • IRQ signal asserted
    … 21 us
  • low level handler which only returns a pulse to thread
    … 37 us
  • my handler starts reading a message
    … 7.3 us
  • handler finishes, MsgReply calls
    … 42.5 us
  • a thread receives a reply


Wojciech Piechowski http://www.mandra.pl/
RADMOR S.A. ul. Hutnicza 3, 81-212 Gdynia, Poland
+48 58 6996735 Wojciech.Piechowski@radmor.com.pl