To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 769
768  |  770
Subject: 
__attribute__ ((rcx_interrrupt)) : how to use ?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Mon, 31 Jan 2000 21:00:51 GMT
Viewed: 
2384 times
  
hi there, i´m still not really sure when and why to use __attribute__
((rcx_interrrupt))

my current assumptions:

1 - it should be used for functions that are called AS interrupt
handlers, to make sure registers are pushed onto the stack, and restored
correctly when function returns.

2 - there is another way to achieve similar behaviour, in case the
compiler doesn´t have the patch: it is to call the Macro
HANDLER_WRAPPER, what will push r0 to r3, call the wrapped function, pop
the registers, and return.

Now my questions:

1 - What is the actual affect of the attribute ?

2 - Is it faster to use  __attribute__ ((rcx_interrrupt)) instead of
HANDLER_WRAPPER, and if so, why ?

3 - What about functions that are called FROM IRQ-handlers, like
lnp_integrity_byte(), or dsound_handler(). Under which conditions do
they have to be declared with the __attribute__ ? -- dsound_handler()
has it, lnp_integrity_byte() does not.

4 - If a function may be called normally or as IRQ-handler, does it harm
to specify the __attribute__ ?

thanks in advance for any hints, Martin



Message has 1 Reply:
  Re: __attribute__ ((rcx_interrrupt)) : how to use ?
 
(...) Right. The calling conventions of the H8 say that r0-r3 are scratch registers (aka caller saves). However, interrupt handlers must preserve ALL of the registers. So the rcx_interrupt attribute makes that happen. (...) The compiler will only (...) (25 years ago, 31-Jan-00, to lugnet.robotics.rcx.legos)

3 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR