Subject:
|
Re: __attribute__ ((rcx_interrrupt)) : how to use ?
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Tue, 1 Feb 2000 19:32:23 GMT
|
Viewed:
|
2185 times
|
| |
| |
Hello Ben, you wrote:
> If you're using rcx_interrupt you
> probably have to use it on any function called in an interrupt context, since
> each one will have to preserve the scratch registers they use (because the top
> level function may not save them).
Well, i got the definitive answer from Markus 8-). It was in german, so
i'll try to translate it:
the effect of __attribute__ ((rcx_interrrupt)) depends on the calling
context:
- in leaf functions (that do not call other functions), it makes sure
all USED registers are saved and restored.
- in all other functions (that do call other functions), it makes sure
ALL registers are saved and restored.
Thus, you have to declare the attribute only for IRQ-handlers. If they
call other functions you do not have to declare the attribute for the
called functions, the compiler will arrange everything -- really great,
isn't it ?
The reason for the functions called from the systime-handler to have the
attribute is: systime-handler is written in assembler for historical
reasons, so it doesn´t save and restore registers as needed.
have a nice day, Martin
|
|
Message is in Reply To:
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|