This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFA]: Document "near" and "far" attributes for HC11/HC12
- From: Stephane Carrez <stcarrez at nerim dot fr>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 24 Mar 2003 23:52:21 +0100
- Subject: [RFA]: Document "near" and "far" attributes for HC11/HC12
Hi!
This patch documents the "near" and "far" attributes for HC11/HC12.
Can you approve it?
Thanks,
Stephane
2003-03-24 Stephane Carrez <stcarrez at nerim dot fr>
* doc/extend.texi (Function Attributes): Document "near" and "far"
for 68HC11 and 68HC12.
Index: doc/extend.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/extend.texi,v
retrieving revision 1.109.2.6
diff -u -p -r1.109.2.6 extend.texi
--- doc/extend.texi 21 Mar 2003 15:04:45 -0000 1.109.2.6
+++ doc/extend.texi 24 Mar 2003 22:48:48 -0000
@@ -2538,6 +2538,30 @@ compiler will generate @code{seth/add3}
and may not be reachable with the @code{bl} instruction (the compiler will
generate the much slower @code{seth/add3/jl} instruction sequence).
+ at item far
+ at cindex functions which handle memory bank switching
+On 68HC11 and 68HC12 the @code{far} attribute causes the compiler to
+use a calling convention that takes care of switching memory banks when
+entering and leaving a function. This calling convention is also the
+default when using the @option{-mlong-calls} option.
+
+On 68HC12 the compiler will use the @code{call} and @code{rtc} instructions
+to call and return from a function.
+
+On 68HC11 the compiler will generate a sequence of instructions
+to invoke a board-specific routine to switch the memory bank and call the
+real function. The board-specific routine simulates a @code{call}.
+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}.
+
+ at item near
+ at cindex functions which do not handle memory bank switching on 68HC11/68HC12
+On 68HC11 and 68HC12 the @code{near} attribute causes the compiler to
+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.
+
@end table
You can specify multiple attributes in a declaration by separating them