fcontext_sparc.hpp 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. #ifndef BOOST_CTX_DETAIL_FCONTEXT_SPARC_H
  6. #define BOOST_CTX_DETAIL_FCONTEXT_SPARC_H
  7. #include <cstddef>
  8. #include <boost/config.hpp>
  9. #include <boost/cstdint.hpp>
  10. #include <boost/context/detail/config.hpp>
  11. #ifdef BOOST_HAS_ABI_HEADERS
  12. # include BOOST_ABI_PREFIX
  13. #endif
  14. namespace boost {
  15. namespace context {
  16. extern "C" {
  17. #define BOOST_CONTEXT_CALLDECL
  18. // if defined(_LP64) we are compiling for sparc64, otherwise it is 32 bit
  19. // sparc.
  20. struct stack_t
  21. {
  22. void * sp;
  23. std::size_t size;
  24. stack_t() :
  25. sp( 0), size( 0)
  26. {}
  27. };
  28. struct fp_t
  29. {
  30. #ifdef _LP64
  31. boost::uint64_t fp_freg[32];
  32. boost::uint64_t fp_fprs, fp_fsr;
  33. #else
  34. boost::uint64_t fp_freg[16];
  35. boost::uint32_t fp_fsr;
  36. #endif
  37. fp_t() :
  38. fp_freg(),
  39. #ifdef _LP64
  40. fp_fprs(),
  41. #endif
  42. fp_fsr()
  43. {}
  44. }
  45. #ifdef _LP64
  46. __attribute__((__aligned__(64))) // allow VIS instructions to be used
  47. #endif
  48. ;
  49. struct fcontext_t
  50. {
  51. fp_t fc_fp; // fpu stuff first, for easier alignement
  52. #ifdef _LP64
  53. boost::uint64_t
  54. #else
  55. boost::uint32_t
  56. #endif
  57. fc_greg[8];
  58. stack_t fc_stack;
  59. fcontext_t() :
  60. fc_fp(),
  61. fc_greg(),
  62. fc_stack()
  63. {}
  64. };
  65. }
  66. }}
  67. #ifdef BOOST_HAS_ABI_HEADERS
  68. # include BOOST_ABI_SUFFIX
  69. #endif
  70. #endif // BOOST_CTX_DETAIL_FCONTEXT_SPARC_H