[Top][All Lists]

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

Re: [avr-gcc-list] 2 tricky questions

From: Marko Panger AGB Lab
Subject: Re: [avr-gcc-list] 2 tricky questions
Date: Tue, 17 Jun 2003 13:33:36 +0200

See below....

----- Original Message -----
From: "Joerg Wunsch" <address@hidden>
To: <address@hidden>
Sent: Tuesday, June 17, 2003 12:08 PM
Subject: Re: [avr-gcc-list] 2 tricky questions

> "Marko Panger AGB Lab" <address@hidden> wrote:
> > 1) In fact I would like to call a macro defined in assembler
> Well, then do it that way. ;-)  Write a macro that declares some
> inline asm.
> #define dosomething asm volatile("do something")
> > 2) The trick with naked attribute should work, but calling
> > "myIntEnter" function puts the return addres onto the stack which is
> > not excatly what I want. I should call an inline function, but as I
> > read there are some troubles with inline functions in GCC.
> You cannot ``call'' an inline function.  Remember, an inline function
> is something that is replaced by the compiler verbatim.

By the "user point of view" calling an inline function is the same as
calling a normal function. The syntax is the same. In fact I was looking for
this. What does the compiler is another issue. I wanted the syntax of a
normal function, but implemented as a macro - inline functions.

> > The best soultion would be to replace the interrupt pro/epi
> > functions with my functions or to call an assembler defined macro.
> By default, they aren't functions but are generated explicitly within
> each function.  Are you using -mcall-prologues?  Then you're getting
> them as functions.

Off course, pro/epi sequences aren't functions. I want to change these
sequences (use mine), but only for interrupts, not for normal functions. So,
is it possible to do this ?

> For normal prologue /functions/, yes, they are really getting their
> return addresses pushed onto the stack.  How else is the function
> supposed to return to the caller?  You probably don't want a function
> for this, but your wording is a bit ambiguous here, sorry.

The returning from the interrupt is managed by me. We misunderstood here.

> > 3) I also tried to define a static inline function and it worked
> > until the function had about 20 instructions, when I have passed
> > this limit the compiler called the function as a normal function.
> That's a known issue.  The outcome was, if you don't like this, don't
> use inline functions but macros.
> --
> J"org Wunsch        Unix support engineer
> address@hidden
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://www.avr1.org/mailman/listinfo/avr-gcc-list

reply via email to

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