gcc: MeP Variable Attributes
1
1 6.32.8 MeP Variable Attributes
1 ------------------------------
1
1 The MeP target has a number of addressing modes and busses. The 'near'
1 space spans the standard memory space's first 16 megabytes (24 bits).
1 The 'far' space spans the entire 32-bit memory space. The 'based' space
1 is a 128-byte region in the memory space that is addressed relative to
1 the '$tp' register. The 'tiny' space is a 65536-byte region relative to
1 the '$gp' register. In addition to these memory regions, the MeP target
1 has a separate 16-bit control bus which is specified with 'cb'
1 attributes.
1
1 'based'
1 Any variable with the 'based' attribute is assigned to the '.based'
1 section, and is accessed with relative to the '$tp' register.
1
1 'tiny'
1 Likewise, the 'tiny' attribute assigned variables to the '.tiny'
1 section, relative to the '$gp' register.
1
1 'near'
1 Variables with the 'near' attribute are assumed to have addresses
1 that fit in a 24-bit addressing mode. This is the default for
1 large variables ('-mtiny=4' is the default) but this attribute can
1 override '-mtiny=' for small variables, or override '-ml'.
1
1 'far'
1 Variables with the 'far' attribute are addressed using a full
1 32-bit address. Since this covers the entire memory space, this
1 allows modules to make no assumptions about where variables might
1 be stored.
1
1 'io'
1 'io (ADDR)'
1 Variables with the 'io' attribute are used to address memory-mapped
1 peripherals. If an address is specified, the variable is assigned
1 that address, else it is not assigned an address (it is assumed
1 some other module assigns an address). Example:
1
1 int timer_count __attribute__((io(0x123)));
1
1 'cb'
1 'cb (ADDR)'
1 Variables with the 'cb' attribute are used to access the control
1 bus, using special instructions. 'addr' indicates the control bus
1 address. Example:
1
1 int cpu_clock __attribute__((cb(0x123)));
1