29.12.2014 Views

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

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.

<strong>Compiler</strong>-specific Features<br />

}<br />

if (!was_masked)<br />

__enable_fiq();<br />

See also<br />

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

4.7.14 __disable_irq<br />

This intrinsic disables IRQ interrupts.<br />

Syntax<br />

int __disable_irq(void)<br />

Note<br />

On <strong>ARM</strong>v7 and <strong>ARM</strong>v7-M, the __disable_irq intrinsic has prototype:<br />

void __disable_irq(void)<br />

Return value<br />

__irq returns the value the IRQ interrupt mask has in the PSR prior to the disabling of<br />

IRQ interrupts.<br />

Example<br />

void foo(void)<br />

{<br />

int was_masked = __disable_irq();<br />

/* ... */<br />

}<br />

if (!was_masked)<br />

__enable_irq();<br />

Restrictions<br />

The __disable_irq 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 />

4-72 Copyright © 2007, 2010 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0348A<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!