3.16 --bitband compiler command-line option

The --bitband command-line option bit-bands all non const global structure objects.

In the following example, when --bitband is applied to foo.c, the write to value.i is bit-banded. That is, the value 0x00000001 is written to the bit-band alias word that value.i maps to in the bit-band region.
Accesses to value.j and value.k are not bit-banded.
/* foo.c */
typedef struct {
  int i : 1;
  int j : 2;
  int k : 3;
} BB;
BB value __attribute__((at(0x20000040))); // Placed object
void update_value(void)
{
  value.i = 1;
  value.j = 0;
}
/* end of foo.c */
armcc supports the bit-banding of objects accessed through absolute addresses. When --bitband is applied to foo.c in the following example, the access to rts is bit-banded.
/* foo.c */
typedef struct {
  int rts : 1;
  int cts : 1;
  unsigned int data;
} uart;
#define com2 (*((volatile uart *)0x20002000))
void put_com2(int n)
{
  com2.rts = 1;
  com2.data = n;
}
/* end of foo.c */
Related concepts
3.14 Compiler and processor support for bit-banding
3.15 Compiler type attribute, __attribute__((bitband))
3.17 How the compiler handles bit-band objects placed outside bit-band regions
Related reference
9.54 __attribute__((bitband)) type attribute
9.60 __attribute__((at(address))) variable attribute
7.13 --bitband
Non-ConfidentialPDF file icon PDF versionARM DUI0375F
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.