avr-gcc-list
[Top][All Lists]
Advanced

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

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


From: Kang Tin LAI
Subject: Re: [avr-gcc-list] 2 tricky questions
Date: Tue, 17 Jun 2003 22:44:04 +0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02

> Who said I want return where I entered the interrupt ???


2) Is it possible to link user defined (my) interrupt prologue and epilogue
functions instead of the integrated ones ?


It is reasonable to believe that a "task switch" is wanted.




--
---
Kang Tin LAI <address@hidden>
-----











Marko Panger AGB Lab wrote:
Mostly to Iztok ?! (sorry others)

Plase read excatly what I have written:

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

Who said I want return where I entered the interrupt ???


If the return from interrupt has to be mingled with, just pop it from

stack

and push another address there  (Like the old PDP11/RSX11 used to do).


This is excatly what I don't want to do ? Why ? Time, precious time, my
friend !!

Don't worry I know how this AVR works and perhaps many other processors.....

Regards,
Marko Panger



----- Original Message -----
From: "Iztok Zupet" <address@hidden>
To: "Marko Panger AGB Lab" <address@hidden>; "Joerg Wunsch"
<address@hidden>
Cc: "Avr-Gcc List" <address@hidden>
Sent: Tuesday, June 17, 2003 2:54 PM
Subject: Re: [avr-gcc-list] 2 tricky questions



On Tuesday 17 June 2003 13:33, Marko Panger AGB Lab wrote:

#define dosomething asm volatile("do something")

I normally use the above trick, like:
#define high(x) \
({unsigned char t;  asm volatile ("lds %0,  (%1+1)" :"=r"(t) :"m"(x));

t;})

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.


BTW, the PROCESSOR iself pushes the return addres to stack when

interrupted

not the GCC!!! That's why it's there in a  _naked_ function.

If the return from interrupt has to be mingled with, just pop it from

stack

and push another address there  (Like the old PDP11/RSX11 used to do).

Iztok




_______________________________________________
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]