libcopp  1.1.0
fcontext_ppc.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_PPC_H
8 #define _COPP_BOOST_CONTEXT_DETAIL_FCONTEXT_PPC_H
9 
10 #include <cstddef>
11 
12 #include <cstddef>
13 #include <stdint.h>
14 
16 #include "libcopp/utils/features.h"
17 
18 #ifdef COPP_HAS_ABI_HEADERS
19 #include COPP_ABI_PREFIX
20 #endif
21 
22 namespace copp {
23  namespace fcontext {
24 
25  extern "C" {
26 
27 #define COPP_BOOST_CONTEXT_CALLDECL
28 
29  struct stack_t {
30  void *sp;
31  std::size_t size;
32 
33  stack_t() : sp(0), size(0) {}
34  };
35 
36  struct fp_t {
37  uint64_t fc_freg[19];
38 
39  fp_t() : fc_freg() {}
40  };
41 
42  struct fcontext_t {
43 #if defined(__powerpc64__)
44  uint64_t fc_greg[23];
45 #else
46  uint32_t fc_greg[23];
47 #endif
48  stack_t fc_stack;
49  fp_t fc_fp;
50 
51  fcontext_t() : fc_greg(), fc_stack(), fc_fp() {}
52  };
53  }
54  }
55 }
56 
57 #ifdef COPP_HAS_ABI_HEADERS
58 #include COPP_ABI_SUFFIX
59 #endif
60 
61 #endif // BOOST_CONTEXT_DETAIL_FCONTEXT_PPC_H