6.32.8 MeP Variable Attributes
The MeP target has a number of addressing modes and busses. The near space spans the standard memory space’s first 16 megabytes (24 bits). The far space spans the entire 32-bit memory space. The based space is a 128-byte region in the memory space that is addressed relative to the $tp register. The tiny space is a 65536-byte region relative to the $gp register. In addition to these memory regions, the MeP target has a separate 16-bit control bus which is specified with cb attributes.
based-
Any variable with the
basedattribute is assigned to the.basedsection, and is accessed with relative to the$tpregister. tiny-
Likewise, the
tinyattribute assigned variables to the.tinysection, relative to the$gpregister. near-
Variables with the
nearattribute are assumed to have addresses that fit in a 24-bit addressing mode. This is the default for large variables (-mtiny=4is the default) but this attribute can override-mtiny=for small variables, or override-ml. far-
Variables with the
farattribute are addressed using a full 32-bit address. Since this covers the entire memory space, this allows modules to make no assumptions about where variables might be stored. ioio (addr)-
Variables with the
ioattribute are used to address memory-mapped peripherals. If an address is specified, the variable is assigned that address, else it is not assigned an address (it is assumed some other module assigns an address). Example:int timer_count __attribute__((io(0x123)));
cbcb (addr)-
Variables with the
cbattribute are used to access the control bus, using special instructions.addrindicates the control bus address. Example:int cpu_clock __attribute__((cb(0x123)));
Next: Microsoft Windows Variable Attributes, Previous: M32R/D Variable Attributes, Up: Variable Attributes [Contents][Index]
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-8.3.0/gcc/MeP-Variable-Attributes.html