This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


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

Re: Interrupt Attribute


David Williams wrote:
> 
> I have been trying David Fiddes distribution of GCC (ECGS1.1.2) for my
> 68EZ328 project and found that it does not seem to support "__attribute__
> ((interrupt))". I get a warning as shown below that suggests it is not
> implemented. Interestingly Scott Howards distribution (also ECGS 1.1.2)
> does support this. If they are both based on the same version of GCC how
> can one support it and the other not. Maybe Scott has added a patch or
> enabled some option when building the compiler?

 Yes, the attribute is an add-on, not in the official release sources, it
isn't even in the recent egcs snapshots. The patches were released in this
list some time ago.

 There are other targets which don't have the attribute either. And there
are even two variations for the attribute name with the targets that
support it :

interrupt
	Use this option on the ARC, AVR, M32R, M68HC11, M68K and V850 to
	indicate that the specified function is an interrupt handler. The
	compiler will generate function entry and exit sequences suitable
	for use in an interrupt handler when this attribute is present.

interrupt_handler
	Use this option on the H8/300[HS], H8/500 and SH to indicate that
	the specified function is an interrupt handler.  The compiler will
	generate function entry and exit sequences suitable for use in an
	interrupt handler when this attribute is present. This option can
	be used also with the V850, as an alternative to the 'interrupt'
	attribute.

 I think that they both should be recognized, or a standard macro name be
used with all GCCs, like putting a :

	#define ISR_FUNC __attribute__((interrupt))
or
	#define ISR_FUNC __attribute__((interrupt_handler))

into the machine dependent things in <sys/config.h> in newlib headers. Then
one could just use the macro like:

	void ISR_FUNC handle_isr(void)
	{
	  <handle it now>
	}

> Maybe I should look at building the compiler myself so I can ensure the
> options and patches I want have been included?

 Yes, this is the sure way...

Cheers, Kai



------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


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