This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: m68k patch reviews


On Friday 22 August 2003 11:44, Gunther Nikl wrote:
> On Thu, Aug 21, 2003 at 08:31:41PM +0200, Bernardo Innocenti wrote:
> > IIRC, the __saveds attribute told the compiler to reload the data section
> > pointer in A4 at function prologue time.
>
>   Yes, when compiling for smalldata.

Yeah, and it's also necessary for compiler-assisted reentrant code
(residentable programs).


> > Then you'll get the old A4 saved on the stack along with other registers
> > automatically, without the need to fiddle with the frame size.
>
>   Something like that is already present. Since with your patch the
>   stacklayout code uses m68k_save_reg() it simply works ;-)

 :-)
 m68k_save_reg() used to be an ugly and unreadable macro before...


> > As for the attribute((interrupt)), wan't it used the same way on the
> > Amiga?
>
>   I don't know if that attribute is any good for AmigaOS.

Hmmm... I think it is only if you're rewriting exec or if you write
an ISR for use with ObtainQuickVector().

Well, it could also be useful for metal bashers writing programs such
as XCopy, but those didn't use C compilers, did they? ;-)


>   Interrupt functions in AmigaOS context are almost normal functions. They
>   have the same scratch registers and must use "rts" to return to the OS.
>   The only thing they must do is to set the condition codes on exit. Thus
>   the interrrupt attribute inserts a "tstl d0" before the "rts".

That's because exec wraps them. Softints are really asynchronous callbacks,
and exec interrupt handlers are called by the interrupt dispatcher, which
is written in assembly like all the rest of exec.

> > In the latter case, I think we could rename this attribute to
> > 'interrupt_handler' and leave the Amiga semantics intact.
>
>   Please do. According the the GCC docs some ports use "interrupt" and some
>   "interrupt_handler".

Yes, I've seen that. I'd just like to check with Peter Baradas if it's ok
to rename the attribute at this point. Peter, do you expect this change to
break much code on embedded targets? If it's acceptable for you, I will go
on and rename it.

-- 
  // Bernardo Innocenti - Develer S.r.l., R&D dept.
\X/  http://www.develer.com/

Please don't send Word attachments - http://www.gnu.org/philosophy/no-word-attachments.html



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]