libcopp  1.1.0
fcontext_mips.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_MIPS_H
8 #define _COPP_BOOST_CONTEXT_DETAIL_FCONTEXT_MIPS_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  // on MIPS we assume 64bit regsiters - even for 32bit ABIs
30 
31  struct stack_t {
32  void *sp;
33  std::size_t size;
34 
35  stack_t() : sp(0), size(0) {}
36  };
37 
38  struct fp_t {
39  uint64_t fc_freg[6];
40 
41  fp_t() : fc_freg() {}
42  };
43 
44  struct fcontext_t {
45  uint32_t fc_greg[12];
46  stack_t fc_stack;
47  fp_t fc_fp;
48 
49  fcontext_t() : fc_greg(), fc_stack(), fc_fp() {}
50  };
51  }
52  }
53 }
54 
55 #ifdef COPP_HAS_ABI_HEADERS
56 #include COPP_ABI_SUFFIX
57 #endif
58 
59 #endif // BOOST_CONTEXT_DETAIL_FCONTEXT_MIPS_H