diff gcc/doc/libgcc.texi @ 67:f6334be47118

update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
date Tue, 22 Mar 2011 17:18:12 +0900
parents a06113de4d67
children 04ced10e8804
line wrap: on
line diff
--- a/gcc/doc/libgcc.texi	Tue May 25 18:58:51 2010 +0900
+++ b/gcc/doc/libgcc.texi	Tue Mar 22 17:18:12 2011 +0900
@@ -1,4 +1,5 @@
-@c Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
+@c Copyright (C) 2003, 2004, 2005, 2006, 2007, 2010
+@c Free Software Foundation, Inc.
 @c This is part of the GCC manual.
 @c For copying conditions, see the file gcc.texi.
 @c Contributed by Aldy Hernandez <aldy@quesejoda.com>
@@ -2262,3 +2263,43 @@
 @deftypefn {Runtime Function} void __clear_cache (char *@var{beg}, char *@var{end})
 This function clears the instruction cache between @var{beg} and @var{end}.
 @end deftypefn
+
+@subsection Split stack functions and variables
+@deftypefn {Runtime Function} {void *} __splitstack_find (void *@var{segment_arg}, @
+void *@var{sp}, size_t @var{len}, void **@var{next_segment}, @
+void **@var{next_sp}, void **@var{initial_sp})
+When using @option{-fsplit-stack}, this call may be used to iterate
+over the stack segments.  It may be called like this:
+@smallexample
+  void *next_segment = NULL;
+  void *next_sp = NULL;
+  void *initial_sp = NULL;
+  void *stack;
+  size_t stack_size;
+  while ((stack = __splitstack_find (next_segment, next_sp,
+                                     &stack_size, &next_segment,
+                                     &next_sp, &initial_sp))
+         != NULL)
+    @{
+      /* Stack segment starts at stack and is
+         stack_size bytes long.  */
+    @}
+@end smallexample
+
+There is no way to iterate over the stack segments of a different
+thread.  However, what is permitted is for one thread to call this
+with the @var{segment_arg} and @var{sp} arguments NULL, to pass
+@var{next_segment}, @var{next_sp}, and @var{initial_sp} to a different
+thread, and then to suspend one way or another.  A different thread
+may run the subsequent @code{__splitstack_find} iterations.  Of
+course, this will only work if the first thread is suspended while the
+second thread is calling @code{__splitstack_find}.  If not, the second
+thread could be looking at the stack while it is changing, and
+anything could happen.
+@end deftypefn
+
+@defvar __morestack_segments
+@defvarx __morestack_current_segment
+@defvarx __morestack_initial_sp
+Internal variables used by the @option{-fsplit-stack} implementation.
+@end defvar