libcopp  1.2.0
fcontext_sparc.hpp
Go to the documentation of this file.
1 // Copyright Martin Husemann 2012
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
5 
6 #ifndef _COPP_BOOST_CTX_DETAIL_FCONTEXT_SPARC_H
7 #define _COPP_BOOST_CTX_DETAIL_FCONTEXT_SPARC_H
8 
9 #include <cstddef>
10 
11 #include <cstddef>
12 #include <stdint.h>
13 
15 #include "libcopp/utils/features.h"
16 
17 #ifdef COPP_HAS_ABI_HEADERS
18 #include COPP_ABI_PREFIX
19 #endif
20 
21 namespace copp {
22  namespace fcontext {
23 
24  extern "C" {
25 
26 #define COPP_BOOST_CONTEXT_CALLDECL
27 
28  // if defined(_LP64) we are compiling for sparc64, otherwise it is 32 bit
29  // sparc.
30 
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 fp_t {
40 #ifdef _LP64
41  uint64_t fp_freg[32];
42  uint64_t fp_fprs, fp_fsr;
43 #else
44  uint64_t fp_freg[16];
45  uint32_t fp_fsr;
46 #endif
47 
48  fp_t()
49  : fp_freg(),
50 #ifdef _LP64
51  fp_fprs(),
52 #endif
53  fp_fsr() {
54  }
55  }
56 #ifdef _LP64
57  __attribute__((__aligned__(64))) // allow VIS instructions to be used
58 #endif
59  ;
60 
61  struct fcontext_t {
62  fp_t fc_fp; // fpu stuff first, for easier alignement
63 #ifdef _LP64
64  uint64_t
65 #else
66  uint32_t
67 #endif
68  fc_greg[8];
69  stack_t fc_stack;
70 
71  fcontext_t() : fc_fp(), fc_greg(), fc_stack() {}
72  };
73  }
74  }
75 }
76 
77 #ifdef COPP_HAS_ABI_HEADERS
78 #include COPP_ABI_SUFFIX
79 #endif
80 
81 #endif // BOOST_CTX_DETAIL_FCONTEXT_SPARC_H
sample endif() if(PROJECT_ENABLE_UNITTEST) add_custom_target(run_test) add_subdirectory("$
Definition: CMakeLists.txt:116