diff options
Diffstat (limited to 'gcc/doc/extend.texi')
-rw-r--r-- | gcc/doc/extend.texi | 162 |
1 files changed, 161 insertions, 1 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 2a9fffa2d06..162d27f3e0a 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -2137,6 +2137,12 @@ present. The @code{deprecated} attribute can also be used for variables and types (@pxref{Variable Attributes}, @pxref{Type Attributes}.) +@item disinterrupt +@cindex @code{disinterrupt} attribute +On MeP targets, this attribute causes the compiler to emit +instructions to disable interrupts for the duration of the given +function. + @item dllexport @cindex @code{__declspec(dllexport)} On Microsoft Windows targets and Symbian OS targets the @@ -2263,6 +2269,10 @@ At the end of a function, it will jump to a board-specific routine instead of using @code{rts}. The board-specific return routine simulates the @code{rtc}. +On MeP targets this causes the compiler to use a calling convention +which assumes the called function is too far away for the built-in +addressing modes. + @item fastcall @cindex functions that pop the argument stack on the 386 On the Intel 386, the @code{fastcall} attribute causes the compiler to @@ -2450,7 +2460,7 @@ This attribute is ignored for R8C target. @item interrupt @cindex interrupt handler functions -Use this attribute on the ARM, AVR, CRX, M32C, M32R/D, m68k, MIPS +Use this attribute on the ARM, AVR, CRX, M32C, M32R/D, m68k, MeP, MIPS and Xstormy16 ports to indicate that the specified function is an interrupt handler. The compiler will generate function entry and exit sequences suitable for use in an interrupt handler when this attribute @@ -2669,6 +2679,10 @@ use the normal calling convention based on @code{jsr} and @code{rts}. This attribute can be used to cancel the effect of the @option{-mlong-calls} option. +On MeP targets this attribute causes the compiler to assume the called +function is close enough to use the normal calling convention, +overriding the @code{-mtf} command line option. + @item nesting @cindex Allow nesting in an interrupt handler on the Blackfin processor. Use this attribute together with @code{interrupt_handler}, @@ -3323,6 +3337,13 @@ visibility of their template. If both the template and enclosing class have explicit visibility, the visibility from the template is used. +@item vliw +@cindex @code{vliw} attribute +On MeP, the @code{vliw} attribute tells the compiler to emit +instructions in VLIW mode instead of core mode. Note that this +attribute is not allowed unless a VLIW coprocessor has been configured +and enabled through command line options. + @item warn_unused_result @cindex @code{warn_unused_result} attribute The @code{warn_unused_result} attribute causes a warning to be emitted @@ -4150,6 +4171,64 @@ Medium and large model objects may live anywhere in the 32-bit address space addresses). @end table +@anchor{MeP Variable Attributes} +@subsection MeP Variable Attributes + +The MeP target has a number of addressing modes and busses. The +@code{near} space spans the standard memory space's first 16 megabytes +(24 bits). The @code{far} space spans the entire 32-bit memory space. +The @code{based} space is a 128 byte region in the memory space which +is addressed relative to the @code{$tp} register. The @code{tiny} +space is a 65536 byte region relative to the @code{$gp} register. In +addition to these memory regions, the MeP target has a separate 16-bit +control bus which is specified with @code{cb} attributes. + +@table @code + +@item based +Any variable with the @code{based} attribute will be assigned to the +@code{.based} section, and will be accessed with relative to the +@code{$tp} register. + +@item tiny +Likewise, the @code{tiny} attribute assigned variables to the +@code{.tiny} section, relative to the @code{$gp} register. + +@item near +Variables with the @code{near} attribute are assumed to have addresses +that fit in a 24-bit addressing mode. This is the default for large +variables (@code{-mtiny=4} is the default) but this attribute can +override @code{-mtiny=} for small variables, or override @code{-ml}. + +@item far +Variables with the @code{far} attribute 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. + +@item io +@item io (@var{addr}) +Variables with the @code{io} attribute 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 will assign an address). Example: + +@example +int timer_count __attribute__((io(0x123))); +@end example + +@item cb +@item cb (@var{addr}) +Variables with the @code{cb} attribute are used to access the control +bus, using special instructions. @code{addr} indicates the control bus +address. Example: + +@example +int cpu_clock __attribute__((cb(0x123))); +@end example + +@end table + @anchor{i386 Variable Attributes} @subsection i386 Variable Attributes @@ -4652,6 +4731,14 @@ virtual table for @code{C} is not exported. (You can use @code{__attribute__} instead of @code{__declspec} if you prefer, but most Symbian OS code uses @code{__declspec}.) +@anchor{MeP Type Attributes} +@subsection MeP Type Attributes + +Many of the MeP variable attributes may be applied to types as well. +Specifically, the @code{based}, @code{tiny}, @code{near}, and +@code{far} attributes may be applied to either. The @code{io} and +@code{cb} attributes may not be applied to types. + @anchor{i386 Type Attributes} @subsection i386 Type Attributes @@ -11703,6 +11790,7 @@ for further explanation. @menu * ARM Pragmas:: * M32C Pragmas:: +* MeP Pragmas:: * RS/6000 and PowerPC Pragmas:: * Darwin Pragmas:: * Solaris Pragmas:: @@ -11753,6 +11841,78 @@ as it may allow you to reduce the number of memregs used. @end table +@node MeP Pragmas +@subsection MeP Pragmas + +@table @code + +@item custom io_volatile (on|off) +@cindex pragma, custom io_volatile +Overrides the command line option @code{-mio-volatile} for the current +file. Note that for compatibility with future GCC releases, this +option should only be used once before any @code{io} variables in each +file. + +@item GCC coprocessor available @var{registers} +@cindex pragma, coprocessor available +Specifies which coprocessor registers are available to the register +allocator. @var{registers} may be a single register, register range +separated by ellipses, or comma-separated list of those. Example: + +@example +#pragma GCC coprocessor available $c0...$c10, $c28 +@end example + +@item GCC coprocessor call_saved @var{registers} +@cindex pragma, coprocessor call_saved +Specifies which coprocessor registers are to be saved and restored by +any function using them. @var{registers} may be a single register, +register range separated by ellipses, or comma-separated list of +those. Example: + +@example +#pragma GCC coprocessor call_saved $c4...$c6, $c31 +@end example + +@item GCC coprocessor subclass '(A|B|C|D)' = @var{registers} +@cindex pragma, coprocessor subclass +Creates and defines a register class. These register classes can be +used by inline @code{asm} constructs. @var{registers} may be a single +register, register range separated by ellipses, or comma-separated +list of those. Example: + +@example +#pragma GCC coprocessor subclass 'B' = $c2, $c4, $c6 + +asm ("cpfoo %0" : "=B" (x)); +@end example + +@item GCC disinterrupt @var{name} , @var{name} @dots{} +@cindex pragma, disinterrupt +For the named functions, the compiler adds code to disable interrupts +for the duration of those functions. Any functions so named, which +are not encountered in the source, cause a warning that the pragma was +not used. Examples: + +@example +#pragma disinterrupt foo +#pragma disinterrupt bar, grill +int foo () @{ @dots{} @} +@end example + +@item GCC call @var{name} , @var{name} @dots{} +@cindex pragma, call +For the named functions, the compiler always uses a register-indirect +call model when calling the named functions. Examples: + +@example +extern int foo (); +#pragma call foo +@end example + +@end table + + @node RS/6000 and PowerPC Pragmas @subsection RS/6000 and PowerPC Pragmas |