You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
5.1 KiB
HTML

<html lang="en">
<head>
<title>Miscellaneous routines - GNU Compiler Collection (GCC) Internals</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="GNU Compiler Collection (GCC) Internals">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Libgcc.html#Libgcc" title="Libgcc">
<link rel="prev" href="Exception-handling-routines.html#Exception-handling-routines" title="Exception handling routines">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
Copyright (C) 1988-2015 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with the
Invariant Sections being ``Funding Free Software'', the Front-Cover
Texts being (a) (see below), and with the Back-Cover Texts being (b)
(see below). A copy of the license is included in the section entitled
``GNU Free Documentation License''.
(a) The FSF's Front-Cover Text is:
A GNU Manual
(b) The FSF's Back-Cover Text is:
You have freedom to copy and modify this GNU Manual, like GNU
software. Copies published by the Free Software Foundation raise
funds for GNU development.-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="Miscellaneous-routines"></a>
<p>
Previous:&nbsp;<a rel="previous" accesskey="p" href="Exception-handling-routines.html#Exception-handling-routines">Exception handling routines</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Libgcc.html#Libgcc">Libgcc</a>
<hr>
</div>
<h3 class="section">4.6 Miscellaneous runtime library routines</h3>
<h4 class="subsection">4.6.1 Cache control functions</h4>
<div class="defun">
&mdash; Runtime Function: void <b>__clear_cache</b> (<var>char *beg, char *end</var>)<var><a name="index-g_t_005f_005fclear_005fcache-1657"></a></var><br>
<blockquote><p>This function clears the instruction cache between <var>beg</var> and <var>end</var>.
</p></blockquote></div>
<h4 class="subsection">4.6.2 Split stack functions and variables</h4>
<div class="defun">
&mdash; Runtime Function: void * <b>__splitstack_find</b> (<var>void *segment_arg, void *sp, size_t len, void **next_segment, void **next_sp, void **initial_sp</var>)<var><a name="index-g_t_005f_005fsplitstack_005ffind-1658"></a></var><br>
<blockquote><p>When using <samp><span class="option">-fsplit-stack</span></samp>, this call may be used to iterate
over the stack segments. It may be called like this:
<pre class="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,
&amp;stack_size, &amp;next_segment,
&amp;next_sp, &amp;initial_sp))
!= NULL)
{
/* Stack segment starts at stack and is
stack_size bytes long. */
}
</pre>
<p>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</var> and <var>sp</var> arguments NULL, to pass
<var>next_segment</var>, <var>next_sp</var>, and <var>initial_sp</var> to a different
thread, and then to suspend one way or another. A different thread
may run the subsequent <code>__splitstack_find</code> iterations. Of
course, this will only work if the first thread is suspended while the
second thread is calling <code>__splitstack_find</code>. If not, the second
thread could be looking at the stack while it is changing, and
anything could happen.
</p></blockquote></div>
<div class="defun">
&mdash; Variable: <b>__morestack_segments</b><var><a name="index-g_t_005f_005fmorestack_005fsegments-1659"></a></var><br>
&mdash; Variable: <b>__morestack_current_segment</b><var><a name="index-g_t_005f_005fmorestack_005fcurrent_005fsegment-1660"></a></var><br>
&mdash; Variable: <b>__morestack_initial_sp</b><var><a name="index-g_t_005f_005fmorestack_005finitial_005fsp-1661"></a></var><br>
<blockquote><p>Internal variables used by the <samp><span class="option">-fsplit-stack</span></samp> implementation.
</p></blockquote></div>
<!-- Copyright (C) 2002-2015 Free Software Foundation, Inc. -->
<!-- This is part of the GCC manual. -->
<!-- For copying conditions, see the file gcc.texi. -->
</body></html>