libcopp  1.1.0
fcontext_i386.hpp
Go to the documentation of this file.
1 
2 // Copyright Oliver Kowalke 2009.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 
7 #ifndef _COPP_BOOST_CONTEXT_DETAIL_FCONTEXT_I386H
8 #define _COPP_BOOST_CONTEXT_DETAIL_FCONTEXT_I386H
9 
10 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
11 #pragma once
12 #endif
13 
14 #include <cstddef>
15 
16 #include <cstddef>
17 #include <stdint.h>
18 
20 #include "libcopp/utils/features.h"
21 
22 #ifdef COPP_HAS_ABI_HEADERS
23 #include COPP_ABI_PREFIX
24 #endif
25 namespace copp {
26  namespace fcontext {
27 
28  extern "C" {
29 
30 #define COPP_BOOST_CONTEXT_CALLDECL __attribute__((cdecl))
31 
32  struct stack_t {
33  void *sp;
34  std::size_t size;
35 
36  stack_t() : sp(0), size(0) {}
37  };
38 
39  struct fcontext_t {
40  uint32_t fc_greg[6];
41  stack_t fc_stack;
42  uint32_t fc_freg[2];
43 
44  fcontext_t() : fc_greg(), fc_stack(), fc_freg() {}
45  };
46  }
47  }
48 }
49 
50 #ifdef COPP_HAS_ABI_HEADERS
51 #include COPP_ABI_SUFFIX
52 #endif
53 #endif // BOOST_CONTEXT_DETAIL_FCONTEXT_I386_H