[Top][All Lists]

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

Re: [avr-gcc-list] code for 90s4433 is using SPH

Subject: Re: [avr-gcc-list] code for 90s4433 is using SPH
Date: Mon, 24 Feb 2003 08:13:28 -0600

>From the IAR C-Compiler manual:

C_task - Disables register stacking on function entry.

Syntax:  storage-class C_task declarator

storage class denotes an optional keyword 'extern' or 'static'
declarator denotes a standard C variable or function declarator.

Normally functions save the values of some registers on the stack on entry.  
declared C_task do not save registers and therefore save stack space.  In normal
circumstances C_task should not be used.  However 'main' can be declared C_task
saving stack space (unless it is called externally as a function) and in 
applications the root function for each task may be declared C_task.

void C_task main( void );

If it's any help.......

>>> address@hidden 02/24/03 07:38AM >>>
As Marek Michalkiewicz wrote:

> > Strange.  Than i'd say that -mtiny-stack doesn't work as announced.
> That's because -mtiny-stack can be used on devices with SPH, too.
> SPH is initialized at startup, and never changed later.  This is
> fine if we know the stack fits within a 256-byte aligned page.

Hmm, after all, it seems it would make sense for us to invent a new
architecture for it, say "avr2small".  The devices in questions are
the AT90S{2313,2323,2333,2343,4433}, ATtiny{22,26}.  For all these,
SPH is not defined and doesn't need to be handled.  Since this will
also save a few bytes of flash, it would make sense to also ship a
different library for them.

> Perhaps a new attribute would be useful - "this function can
> return, but it's OK to clobber all registers, no need to save
> anything".  It's called "OS_Task" in the h8300 port, but not
> documented anywhere - should we use the same name?  Is this
> the same thing as "__C_task void main(void)" in IAR C code?

No idea about AVR, but it sounds useful to me.  We could even include
a prototype for main() in a central header file.

J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/ 

avr-gcc-list mailing list

reply via email to

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