avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [avr-libc-dev] vector section disable, vector redirection


From: Jörg Diederich
Subject: RE: [avr-libc-dev] vector section disable, vector redirection
Date: Wed, 15 Aug 2007 08:35:30 +0100

hello,

> I like the idea of being able to optionally remove the vector section. I
> have had a customer ask about if such a thing could be done. Would you be
> willing to work up patches that implements such an idea? I know that you
> will also have to patch GNU Binutils to change the linker script.

yes, i can do so and propose a patch here. i know, joerg wunsch liked to change 
the way irq's are included too. he mentioned this in a german forum some days 
ago.

 
> I'm not so sure about this one. If I understand your example code, this
> would be permanently changing the way that interrupts are handled now to do
> this redirection, but at a cost of adding this extra code. If an ISR calls a
> function then this vector redirection would produce smaller code than the
> current implementation, correct? 

i think so.

> But if the ISR does not call a function,
> then it looks like this vector redirection system would still introduce a
> code overhead, correct? If so, then doing this would be unacceptable for
> smaller devices with minimal code space.

yes, that's correct. as there were all vectors defined by default, overhead is 
introduced for unused vectors. there's some idea coming up about this, but it's 
to early to discuss about it.


> Plus, you're proposing to make these changes:
> 
> #define ISR(vector)                                     \
>    void vector (void) __attribute__ ((signal)); \
>    void vector (void)
> #endif
> 
> ...
> 
> /* External Interrupt Request 0 */
> #define INT0_vect                       1
> #define SIG_INTERRUPT0                  1
> 
> Which means that when I write:
> 
> ISR(INT0_vect)
> {
> ....
> }
> 
> Then it will be preprocessed into:
> 
> void 1 (void) attribute__ ((signal));
> void 1 (void)
> {
> ...
> }

no, not exacty. the idea is to move the _VECTOR(x) macros from each io.h to the 
interrupt.h . there it is at a central place and better situated, i guess. each 
io.h contains only number macros for the interrupts instead of _VECTOR(x) like 
1,2 3,..,37 . maybe this could allow future changes in interrupt naming of 
handling more easily too.

#define ISR(vector)                                     \
   void _VECTOR(vector) (void) __attribute__ ((signal)); \
   void _VECTOR(vector) (void)
#endif

assumed, each io.h contains only numbers for vector names, that will be 
preprocessed into the same scheme as today: (e.g. for int0)
void _VECTOR(1) (void) attribute__ ((signal));
void _VECTOR(1) (void)
{
 ...
}
which would be processed later to __vector_1, as always done at the moment.

> Have you (and/or your supervisor) actually implemented and tried this
> scheme?

yes, i did. tried just two timers /time 1 and 3) do to lack of external 
interrupts, but it worked like it was intended to do. there was no need to 
explicitly using additional macros for dealing with interrupts anymore. all 
changes necessary were to adapt interrupt.h, as explained, and the used 
io.h-instance (iocanxxx.h in my setup)

bye jörg

=


-- 
Powered By Outblaze




reply via email to

[Prev in Thread] Current Thread [Next in Thread]