libcopp  2.2.0
fcontext_sparc.hpp
Go to the documentation of this file.
1 // Copyright 2023 owent
2 
3 #pragma once
4 
5 #include <libcopp/utils/config/libcopp_build_features.h>
6 
7 // clang-format off
8 #include <libcopp/utils/config/stl_include_prefix.h> // NOLINT(build/include_order)
9 // clang-format on
10 #include <stdint.h>
11 #include <cstddef>
12 // clang-format off
13 #include <libcopp/utils/config/stl_include_suffix.h> // NOLINT(build/include_order)
14 // clang-format on
15 
17 #include "libcopp/utils/features.h"
18 
19 #ifdef COPP_HAS_ABI_HEADERS
20 # include COPP_ABI_PREFIX
21 #endif
22 
23 LIBCOPP_COPP_NAMESPACE_BEGIN
24 namespace fcontext {
25 
26 extern "C" {
27 
28 #define COPP_BOOST_CONTEXT_CALLDECL
29 
30 // if defined(_LP64) we are compiling for sparc64, otherwise it is 32 bit
31 // sparc.
32 
33 struct stack_t {
34  void *sp;
35  std::size_t size;
36 
37  stack_t() : sp(0), size(0) {}
38 };
39 
40 struct fp_t {
41 #ifdef _LP64
42  uint64_t fp_freg[32];
43  uint64_t fp_fprs, fp_fsr;
44 #else
45  uint64_t fp_freg[16];
46  uint32_t fp_fsr;
47 #endif
48 
49  fp_t()
50  : fp_freg(),
51 #ifdef _LP64
52  fp_fprs(),
53 #endif
54  fp_fsr() {
55  }
56 }
57 #ifdef _LP64
58 __attribute__((__aligned__(64))) // allow VIS instructions to be used
59 #endif
60 ;
61 
62 struct fcontext_t {
63  fp_t fc_fp; // fpu stuff first, for easier alignement
64 #ifdef _LP64
65  uint64_t
66 #else
67  uint32_t
68 #endif
69  fc_greg[8];
70  stack_t fc_stack;
71 
73 };
74 }
75 } // namespace fcontext
76 LIBCOPP_COPP_NAMESPACE_END
77 
78 #ifdef COPP_HAS_ABI_HEADERS
79 # include COPP_ABI_SUFFIX
80 #endif
void * fcontext_t
Definition: fcontext.hpp:27
uint32_t fc_greg[11]
uint64_t fp_freg[16]
std::size_t size