04.01.2015 Views

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Compiler-specific Features<br />

The __disable_fiq intrinsic can only be executed in privileged modes, that is, in non<br />

user modes. In User mode this intrinsic does not change the interrupt flags in the CPSR.<br />

Example<br />

void foo(void)<br />

{<br />

int was_masked = __disable_fiq();<br />

/* ... */<br />

if (!was_masked)<br />

__enable_fiq();<br />

}<br />

See also<br />

• __enable_fiq on page 4-82.<br />

4.7.8 __disable_irq<br />

This intrinsic disables IRQ interrupts.<br />

Note<br />

Typically, this intrinsic disables IRQ interrupts by setting the I-bit in the CPSR.<br />

However, for M-profile it sets the exception mask register (PRIMASK).<br />

Syntax<br />

int __disable_irq(void);<br />

void __disable_irq(void);<br />

Usage<br />

The function prototype to use for this intrinsic depends on the target architecture you<br />

are compiling for. For <strong>ARM</strong>v7 (--cpu=7), use void __disable_irq(void);. For all other<br />

architectures, including <strong>ARM</strong>v7-A, <strong>ARM</strong>v7-R, and <strong>ARM</strong>v7-M, you can use<br />

int __disable_irq(void); or void __disable_irq(void);.<br />

Return value<br />

int __disable_irq(void); returns the value the IRQ interrupt mask has in the PSR prior<br />

to the disabling of IRQ interrupts.<br />

4-80 Copyright © 2007-2010 <strong>ARM</strong>. All rights reserved. <strong>ARM</strong> DUI 0348C<br />

Non-Confidential,<br />

ID101213

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!