libcopp 2.3.1
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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
18
19#ifdef LIBCOPP_HAS_ABI_HEADERS
20# include LIBCOPP_ABI_PREFIX
21#endif
22
23LIBCOPP_COPP_NAMESPACE_BEGIN
24namespace fcontext {
25
26extern "C" {
27
28#define LIBCOPP_BOOST_CONTEXT_CALLDECL
29
30// if defined(_LP64) we are compiling for sparc64, otherwise it is 32 bit
31// sparc.
32
33struct stack_t {
34 void *sp;
35 std::size_t size;
36
37 stack_t() : sp(0), size(0) {}
38};
39
40struct 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
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
62struct 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
76LIBCOPP_COPP_NAMESPACE_END
77
78#ifdef LIBCOPP_HAS_ABI_HEADERS
79# include LIBCOPP_ABI_SUFFIX
80#endif
uint64_t fp_freg[16]