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

BB bb __attribute__((at(0x20000004)));<br />

void foo(void)<br />

{<br />

bb.i = 1;<br />

}<br />

For peripherals that are width-sensitive, byte, halfword, and word stores or loads to the<br />

alias space are generated for char, short, and int types of bitfields of bit-banded structs<br />

respectively.<br />

In Example 4-7 bit-banded access is generated for bb.i.<br />

Example 4-7 Bitfield bit-band access<br />

typedef struct {<br />

char i: 1;<br />

int j: 2;<br />

int k: 3;<br />

} BB __attribute__((bitband));<br />

BB bb __attribute__((at(0x20000004)));<br />

void foo()<br />

{<br />

bb.i = 1;<br />

}<br />

If you do not use __attribute__((at())) to place the bit-banded variable in the bit-band<br />

region then you must relocate it using another method. You can do this by either using<br />

an appropriate scatter-loading description file or by using the --rw_base linker<br />

command-line option. See the Linker Reference Guide for more information.<br />

Restrictions<br />

The following restrictions apply:<br />

• This type attribute can only be used with struct. Any union type or other<br />

aggregate type with a union as a member cannot be bit-banded.<br />

• Members of structs cannot be bit-banded individually.<br />

• Bit-banded accesses are generated only for single-bit bitfields.<br />

4-44 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!