[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-libc-dev] [task #7546] Rework the default interrupt handler
From: |
Joerg Wunsch |
Subject: |
[avr-libc-dev] [task #7546] Rework the default interrupt handler |
Date: |
Sat, 22 Dec 2007 20:34:54 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.13) Gecko/20070224 Galeon/2.0.3 |
URL:
<http://savannah.nongnu.org/task/?7546>
Summary: Rework the default interrupt handler
Project: AVR C Runtime Library
Submitted by: joerg_wunsch
Submitted on: Saturday 12/22/2007 at 21:34
Should Start On: Saturday 12/22/2007 at 00:00
Should be Finished on: Saturday 12/22/2007 at 00:00
Category: None
Priority: 5 - Normal
Status: None
Privacy: Public
Percent Complete: 0%
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Details:
Right now, the default interrupt handler eventually ends up
in restarting the application at address 0, so the user-
visible effect is almost similar to a reset, which has turned
out to cause minor surprises occasionally.
Other ideas have been discussed about the default ISR. Just
using a RETI is not really better: some interrupts are not
auto-clearing so they would end up in an infinite loop, and
in all other cases a missing ISR is a programming error most
of the time which would go completely unnoticed for a long
time then.
The best idea so far came once from Peter Dannegger. He
suggested to CALL/RCALL the default handler from within the
vector table, rather than JMP/RJMP to it. That way, the
default handler can then pop the return address into a register
where it can be examined with a debugger (or inside the default
handler itself if it's a custom handler). That way, programmers
will get an idea *what* interrupt triggered.
Finally, the default handler should best run into an infinite
loop with interrupts disabled. abort() has been suggested a
possible implementation for that which is already there.
The difficulty of this idea is that the current scheme to
fill the vector table with JMP/RJMP instructions to locations
that are eventually inserted by the linker won't work anymore.
A new scheme would be needed where by default, a CALL/RCALL
is placed into the slot, and is then replaced by a jump
instructions for all vectors that are actually defined by
the application.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/task/?7546>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [avr-libc-dev] [task #7546] Rework the default interrupt handler,
Joerg Wunsch <=