summaryrefslogtreecommitdiff
path: root/libs/context/doc/html/context/context/boost_fcontext.html
blob: fad862482b5a3648e0b123259a35ee1d4d63af7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Struct fcontext_t and related functions</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="../../index.html" title="Context">
<link rel="up" href="../context.html" title="Context">
<link rel="prev" href="../context.html" title="Context">
<link rel="next" href="../stack.html" title="Stack allocation">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../context.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../context.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../stack.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="context.context.boost_fcontext"></a><a class="link" href="boost_fcontext.html" title="Struct fcontext_t and related functions">Struct <code class="computeroutput"><span class="identifier">fcontext_t</span></code> and related functions</a>
</h3></div></div></div>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">stack_t</span>
<span class="special">{</span>
    <span class="keyword">void</span>    <span class="special">*</span>   <span class="identifier">base</span><span class="special">;</span>
    <span class="keyword">void</span>    <span class="special">*</span>   <span class="identifier">limit</span><span class="special">;</span>
<span class="special">};</span>

<span class="keyword">struct</span> <span class="identifier">fcontext_t</span>
<span class="special">{</span>
    <span class="special">&lt;</span> <span class="identifier">platform</span> <span class="identifier">specific</span> <span class="special">&gt;</span>

    <span class="identifier">stack_t</span>  <span class="identifier">fc_stack</span><span class="special">;</span>
<span class="special">};</span>

<span class="identifier">intptr_t</span> <span class="identifier">jump_fcontext</span><span class="special">(</span> <span class="identifier">fcontext_t</span> <span class="special">*</span> <span class="identifier">ofc</span><span class="special">,</span> <span class="identifier">fcontext_t</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">nfc</span><span class="special">,</span> <span class="identifier">intptr_t</span> <span class="identifier">vp</span><span class="special">);</span>
<span class="keyword">void</span> <span class="identifier">make_fcontext</span><span class="special">(</span> <span class="identifier">fcontext_t</span> <span class="special">*</span> <span class="identifier">fc</span><span class="special">,</span> <span class="keyword">void</span><span class="special">(*</span> <span class="identifier">fn</span><span class="special">)(</span><span class="identifier">intptr_t</span><span class="special">)</span> <span class="special">);</span>
</pre>
<h5>
<a name="context.context.boost_fcontext.h0"></a>
        <span><a name="context.context.boost_fcontext._code__phrase_role__identifier__base__phrase___code_"></a></span><a class="link" href="boost_fcontext.html#context.context.boost_fcontext._code__phrase_role__identifier__base__phrase___code_"><code class="computeroutput"><span class="identifier">base</span></code></a>
      </h5>
<div class="variablelist">
<p class="title"><b></b></p>
<dl>
<dt><span class="term">Member:</span></dt>
<dd><p>
              Pointer to the top of the stack.
            </p></dd>
</dl>
</div>
<h5>
<a name="context.context.boost_fcontext.h1"></a>
        <span><a name="context.context.boost_fcontext._code__phrase_role__identifier__limit__phrase___code_"></a></span><a class="link" href="boost_fcontext.html#context.context.boost_fcontext._code__phrase_role__identifier__limit__phrase___code_"><code class="computeroutput"><span class="identifier">limit</span></code></a>
      </h5>
<div class="variablelist">
<p class="title"><b></b></p>
<dl>
<dt><span class="term">Member:</span></dt>
<dd><p>
              Pointer to the bottom of the stack.
            </p></dd>
</dl>
</div>
<h5>
<a name="context.context.boost_fcontext.h2"></a>
        <span><a name="context.context.boost_fcontext._code__phrase_role__identifier__fc_stack__phrase___code_"></a></span><a class="link" href="boost_fcontext.html#context.context.boost_fcontext._code__phrase_role__identifier__fc_stack__phrase___code_"><code class="computeroutput"><span class="identifier">fc_stack</span></code></a>
      </h5>
<div class="variablelist">
<p class="title"><b></b></p>
<dl>
<dt><span class="term">Member:</span></dt>
<dd><p>
              Tracks the memory for the context's stack.
            </p></dd>
</dl>
</div>
<h5>
<a name="context.context.boost_fcontext.h3"></a>
        <span><a name="context.context.boost_fcontext._code__phrase_role__identifier__intptr_t__phrase___phrase_role__identifier__jump_fcontext__phrase__phrase_role__special_____phrase___phrase_role__identifier__fcontext_t__phrase___phrase_role__special_____phrase___phrase_role__identifier__ofc__phrase__phrase_role__special_____phrase___phrase_role__identifier__fcontext_t__phrase___phrase_role__special_____phrase___phrase_role__identifier__nfc__phrase__phrase_role__special_____phrase___phrase_role__identifier__intptr_t__phrase___phrase_role__identifier__p__phrase__phrase_role__special_____phrase___phrase_role__keyword__bool__phrase___phrase_role__identifier__preserve_fpu__phrase__phrase_role__special_____phrase___code_"></a></span><a class="link" href="boost_fcontext.html#context.context.boost_fcontext._code__phrase_role__identifier__intptr_t__phrase___phrase_role__identifier__jump_fcontext__phrase__phrase_role__special_____phrase___phrase_role__identifier__fcontext_t__phrase___phrase_role__special_____phrase___phrase_role__identifier__ofc__phrase__phrase_role__special_____phrase___phrase_role__identifier__fcontext_t__phrase___phrase_role__special_____phrase___phrase_role__identifier__nfc__phrase__phrase_role__special_____phrase___phrase_role__identifier__intptr_t__phrase___phrase_role__identifier__p__phrase__phrase_role__special_____phrase___phrase_role__keyword__bool__phrase___phrase_role__identifier__preserve_fpu__phrase__phrase_role__special_____phrase___code_"><code class="computeroutput"><span class="identifier">intptr_t</span> <span class="identifier">jump_fcontext</span><span class="special">(</span> <span class="identifier">fcontext_t</span>
        <span class="special">*</span> <span class="identifier">ofc</span><span class="special">,</span> <span class="identifier">fcontext_t</span>
        <span class="special">*</span> <span class="identifier">nfc</span><span class="special">,</span> <span class="identifier">intptr_t</span> <span class="identifier">p</span><span class="special">,</span> <span class="keyword">bool</span>
        <span class="identifier">preserve_fpu</span><span class="special">)</span></code></a>
      </h5>
<div class="variablelist">
<p class="title"><b></b></p>
<dl>
<dt><span class="term">Effects:</span></dt>
<dd><p>
              Stores the current context data (stack pointer, instruction pointer,
              and CPU registers) to <code class="computeroutput"><span class="special">*</span><span class="identifier">ofc</span></code> and restores the context data
              from <code class="computeroutput"><span class="special">*</span><span class="identifier">nfc</span></code>,
              which implies jumping to <code class="computeroutput"><span class="special">*</span><span class="identifier">nfc</span></code>'s execution context. The intptr_t
              argument, <code class="computeroutput"><span class="identifier">p</span></code>, is passed
              to the current context to be returned by the most recent call to <code class="computeroutput"><span class="identifier">jump_fcontext</span><span class="special">()</span></code>
              in the same thread. The last argument controls if fpu registers have
              to be preserved.
            </p></dd>
<dt><span class="term">Returns:</span></dt>
<dd><p>
              The third pointer argument passed to the most recent call to <code class="computeroutput"><span class="identifier">jump_fcontext</span><span class="special">()</span></code>,
              if any.
            </p></dd>
</dl>
</div>
<h5>
<a name="context.context.boost_fcontext.h4"></a>
        <span><a name="context.context.boost_fcontext._code__phrase_role__keyword__void__phrase___phrase_role__identifier__make_fcontext__phrase__phrase_role__special_____phrase___phrase_role__identifier__fcontext_t__phrase___phrase_role__special_____phrase___phrase_role__identifier__fc__phrase__phrase_role__special_____phrase___phrase_role__keyword__void__phrase__phrase_role__special______phrase__phrase_role__identifier__fn__phrase__phrase_role__special______phrase__phrase_role__identifier__intptr_t__phrase__phrase_role__special______phrase___code_"></a></span><a class="link" href="boost_fcontext.html#context.context.boost_fcontext._code__phrase_role__keyword__void__phrase___phrase_role__identifier__make_fcontext__phrase__phrase_role__special_____phrase___phrase_role__identifier__fcontext_t__phrase___phrase_role__special_____phrase___phrase_role__identifier__fc__phrase__phrase_role__special_____phrase___phrase_role__keyword__void__phrase__phrase_role__special______phrase__phrase_role__identifier__fn__phrase__phrase_role__special______phrase__phrase_role__identifier__intptr_t__phrase__phrase_role__special______phrase___code_"><code class="computeroutput"><span class="keyword">void</span> <span class="identifier">make_fcontext</span><span class="special">(</span> <span class="identifier">fcontext_t</span>
        <span class="special">*</span> <span class="identifier">fc</span><span class="special">,</span> <span class="keyword">void</span><span class="special">(*</span><span class="identifier">fn</span><span class="special">)(</span><span class="identifier">intptr_t</span><span class="special">))</span></code></a>
      </h5>
<div class="variablelist">
<p class="title"><b></b></p>
<dl>
<dt><span class="term">Precondition:</span></dt>
<dd><p>
              A stack is applied to <code class="computeroutput"><span class="special">*</span><span class="identifier">fc</span></code> before <code class="computeroutput"><span class="identifier">make_fcontext</span><span class="special">()</span></code> is called.
            </p></dd>
<dt><span class="term">Effects:</span></dt>
<dd><p>
              Modifies <code class="computeroutput"><span class="special">*</span><span class="identifier">fc</span></code>
              in order to execute <code class="computeroutput"><span class="identifier">fn</span></code>
              when the context is activated next.
            </p></dd>
</dl>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009 Oliver Kowalke<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../context.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../context.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../stack.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>