Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: C question

2006-03-18 by heedaf

So is the "__" in __irq specific to the compiler since it gives me 
an error in CrossStudio?  

--- In lpc2000@yahoogroups.com, "Andrew Berney" <amb@...> wrote:
>
> I am guessing that it's simply a keyword to inform the compiler 
gracefully
> that it will need to apply a sub of 4/8 bytes from the Link 
Register before
> it returns from the IRQ function.
> 
> The reasoning being that having entered an FIQ/IRQ the link 
register will
> contain the address of the discarded instruction + 4, this way the 
compiler
> understands it needs to put in a SUBS R15, R14, #4 instruction 
rather than
> simply copying R15 back onto R14 as per a SWI. That said in the 
case of a
> data abort the exception will actually have occured one 
instruction after
> the execution of the instruction that threw the exception, in this 
case we
> need to go back 2 instructions and therefore apply: SUBS R15, R14, 
#8.
> Following this its plain sailing - simply restoring the user mode 
and
> copying the SPSR to the CPSR and we're back to processing user 
code at the
> point where we were interrupted.
> 
> Andy
> 
> -----Original Message-----
> From: lpc2000@yahoogroups.com [mailto:lpc2000@yahoogroups.com]On 
Behalf
> Of Jack Key
> Sent: 17 March 2006 13:28
> To: lpc2000@yahoogroups.com
> Subject: Re: [lpc2000] C question
> 
> 
> The Keil CA Compiler implements the keywords __irq and __fiq. With 
the __fiq
> keyword the compiler does not save the CPU registers R8 - R12, 
since the ARM
> CPU implements separate registers in the FIQ mode.
> 
>   This is what the keil help says. Above that I do not know 
anything more
> than the obvious fact that __irq tells the function that it is an 
irq
> interrupt. Then you may ask what is the use of the register 
VICIntSelect. I
> too dont know the answer for that. Anyways, hope my effort was of 
any help.
> 
>   Regards,
>   Jack.
> heedaf <ruffellfamily@...> wrote:
>   I have a newbie question.  In the following code
> 
>     void ADC0Handler (void) __irq
> 
> What does __irq do?  I've never seen this before.  It comes from 
the
> Kiel ADC sample listed Philips website.
> Thanks,
> Dewayne
> 
> 
> 
> 
> 
>   SPONSORED LINKS
>         Microcontrollers   Microprocessor   Intel 
microprocessors     Pic
> microcontrollers
> 
> ---------------------------------
>   YAHOO! GROUPS LINKS
> 
> 
>     Visit your group "lpc2000" on the web.
> 
>     To unsubscribe from this group, send an email to:
>  lpc2000-unsubscribe@yahoogroups.com
> 
>     Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service.
> 
> 
> ---------------------------------
> 
> 
> 
> 
> 
> ---------------------------------
>  Yahoo! Mail
>  Use Photomail to share photos without annoying attachments.
> 
> [Non-text portions of this message have been removed]
> 
> 
> 
> 
> Yahoo! Groups Links
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.