summaryrefslogtreecommitdiff
path: root/boost/context/detail
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2013-08-26 08:15:55 -0400
committerAnas Nashif <anas.nashif@intel.com>2013-08-26 08:15:55 -0400
commitbb4dd8289b351fae6b55e303f189127a394a1edd (patch)
tree77c9c35a31b1459dd7988c2448e797d142530c41 /boost/context/detail
parent1a78a62555be32868418fe52f8e330c9d0f95d5a (diff)
downloadboost-bb4dd8289b351fae6b55e303f189127a394a1edd.tar.gz
boost-bb4dd8289b351fae6b55e303f189127a394a1edd.tar.bz2
boost-bb4dd8289b351fae6b55e303f189127a394a1edd.zip
Imported Upstream version 1.51.0upstream/1.51.0
Diffstat (limited to 'boost/context/detail')
-rw-r--r--boost/context/detail/config.hpp42
-rw-r--r--boost/context/detail/fcontext_arm.hpp66
-rw-r--r--boost/context/detail/fcontext_i386.hpp68
-rw-r--r--boost/context/detail/fcontext_i386_win.hpp83
-rw-r--r--boost/context/detail/fcontext_mips.hpp68
-rw-r--r--boost/context/detail/fcontext_ppc.hpp70
-rw-r--r--boost/context/detail/fcontext_x86_64.hpp66
-rw-r--r--boost/context/detail/fcontext_x86_64_win.hpp90
8 files changed, 553 insertions, 0 deletions
diff --git a/boost/context/detail/config.hpp b/boost/context/detail/config.hpp
new file mode 100644
index 0000000000..50ada3c507
--- /dev/null
+++ b/boost/context/detail/config.hpp
@@ -0,0 +1,42 @@
+
+// Copyright Oliver Kowalke 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CTX_DETAIL_CONFIG_H
+#define BOOST_CTX_DETAIL_CONFIG_H
+
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+
+#ifdef BOOST_CONTEXT_DECL
+# undef BOOST_CONTEXT_DECL
+#endif
+
+#if defined(BOOST_HAS_DECLSPEC)
+# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CONTEXT_DYN_LINK)
+# if ! defined(BOOST_DYN_LINK)
+# define BOOST_DYN_LINK
+# endif
+# if defined(BOOST_CONTEXT_SOURCE)
+# define BOOST_CONTEXT_DECL BOOST_SYMBOL_EXPORT
+# else
+# define BOOST_CONTEXT_DECL BOOST_SYMBOL_IMPORT
+# endif
+# endif
+#endif
+
+#if ! defined(BOOST_CONTEXT_DECL)
+# define BOOST_CONTEXT_DECL
+#endif
+
+#if ! defined(BOOST_CONTEXT_SOURCE) && ! defined(BOOST_ALL_NO_LIB) && ! defined(BOOST_CONTEXT_NO_LIB)
+# define BOOST_LIB_NAME boost_context
+# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CONTEXT_DYN_LINK)
+# define BOOST_DYN_LINK
+# endif
+# include <boost/config/auto_link.hpp>
+#endif
+
+#endif // BOOST_CTX_DETAIL_CONFIG_H
diff --git a/boost/context/detail/fcontext_arm.hpp b/boost/context/detail/fcontext_arm.hpp
new file mode 100644
index 0000000000..b4ed2fa264
--- /dev/null
+++ b/boost/context/detail/fcontext_arm.hpp
@@ -0,0 +1,66 @@
+
+// Copyright Oliver Kowalke 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CTX_DETAIL_FCONTEXT_ARM_H
+#define BOOST_CTX_DETAIL_FCONTEXT_ARM_H
+
+#include <boost/config.hpp>
+#include <boost/cstdint.hpp>
+
+#include <boost/context/detail/config.hpp>
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost {
+namespace ctx {
+
+extern "C" {
+
+#define BOOST_CONTEXT_CALLDECL
+
+struct stack_t
+{
+ void * base;
+ void * limit;
+
+ stack_t() :
+ base( 0), limit( 0)
+ {}
+};
+
+struct fp_t
+{
+ boost::uint32_t fc_freg[16];
+
+ fp_t() :
+ fc_freg()
+ {}
+};
+
+struct fcontext_t
+{
+ boost::uint32_t fc_greg[11];
+ stack_t fc_stack;
+ fp_t fc_fp;
+
+ fcontext_t() :
+ fc_greg(),
+ fc_stack(),
+ fc_fp()
+ {}
+};
+
+}
+
+}}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif // BOOST_CTX_DETAIL_FCONTEXT_ARM_H
diff --git a/boost/context/detail/fcontext_i386.hpp b/boost/context/detail/fcontext_i386.hpp
new file mode 100644
index 0000000000..573a22caf3
--- /dev/null
+++ b/boost/context/detail/fcontext_i386.hpp
@@ -0,0 +1,68 @@
+
+// Copyright Oliver Kowalke 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CTX_DETAIL_FCONTEXT_I386H
+#define BOOST_CTX_DETAIL_FCONTEXT_I386H
+
+#include <cstddef>
+
+#include <boost/config.hpp>
+#include <boost/cstdint.hpp>
+
+#include <boost/context/detail/config.hpp>
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost {
+namespace ctx {
+
+extern "C" {
+
+#define BOOST_CONTEXT_CALLDECL __attribute__((cdecl))
+
+struct stack_t
+{
+ void * base;
+ void * limit;
+
+ stack_t() :
+ base( 0), limit( 0)
+ {}
+};
+
+struct fp_t
+{
+ boost::uint32_t fc_freg[2];
+
+ fp_t() :
+ fc_freg()
+ {}
+};
+
+struct fcontext_t
+{
+ boost::uint32_t fc_greg[6];
+ stack_t fc_stack;
+ fp_t fc_fp;
+
+ fcontext_t() :
+ fc_greg(),
+ fc_stack(),
+ fc_fp()
+ {}
+};
+
+}
+
+}}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif // BOOST_CTX_DETAIL_FCONTEXT_I386_H
diff --git a/boost/context/detail/fcontext_i386_win.hpp b/boost/context/detail/fcontext_i386_win.hpp
new file mode 100644
index 0000000000..e250ec5e3b
--- /dev/null
+++ b/boost/context/detail/fcontext_i386_win.hpp
@@ -0,0 +1,83 @@
+
+// Copyright Oliver Kowalke 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CTX_DETAIL_FCONTEXT_I386H
+#define BOOST_CTX_DETAIL_FCONTEXT_I386H
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <boost/config.hpp>
+#include <boost/cstdint.hpp>
+
+#include <boost/context/detail/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(push)
+#pragma warning(disable:4351)
+#endif
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost {
+namespace ctx {
+
+extern "C" {
+
+#define BOOST_CONTEXT_CALLDECL __cdecl
+
+struct stack_t
+{
+ void * base;
+ void * limit;
+
+ stack_t() :
+ base( 0), limit( 0)
+ {}
+};
+
+struct fp_t
+{
+ boost::uint32_t fc_freg[2];
+
+ fp_t() :
+ fc_freg()
+ {}
+};
+
+struct fcontext_t
+{
+ boost::uint32_t fc_greg[6];
+ stack_t fc_stack;
+ void * fc_excpt_lst;
+ void * fc_local_storage;
+ fp_t fc_fp;
+
+ fcontext_t() :
+ fc_greg(),
+ fc_stack(),
+ fc_excpt_lst( 0),
+ fc_local_storage( 0),
+ fc_fp()
+ {}
+};
+
+}
+
+}}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#if defined(BOOST_MSVC)
+#pragma warning(pop)
+#endif
+
+#endif // BOOST_CTX_DETAIL_FCONTEXT_I386_H
diff --git a/boost/context/detail/fcontext_mips.hpp b/boost/context/detail/fcontext_mips.hpp
new file mode 100644
index 0000000000..1645adfb8b
--- /dev/null
+++ b/boost/context/detail/fcontext_mips.hpp
@@ -0,0 +1,68 @@
+
+// Copyright Oliver Kowalke 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CTX_DETAIL_FCONTEXT_MIPS_H
+#define BOOST_CTX_DETAIL_FCONTEXT_MIPS_H
+
+#include <boost/config.hpp>
+#include <boost/cstdint.hpp>
+
+#include <boost/context/detail/config.hpp>
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost {
+namespace ctx {
+
+extern "C" {
+
+#define BOOST_CONTEXT_CALLDECL
+
+// on MIPS we assume 64bit regsiters - even for 32bit ABIs
+
+struct stack_t
+{
+ void * base;
+ void * limit;
+
+ stack_t() :
+ base( 0), limit( 0)
+ {}
+};
+
+struct fp_t
+{
+ boost::uint64_t fc_freg[6];
+
+ fp_t() :
+ fc_freg()
+ {}
+};
+
+struct fcontext_t
+{
+ boost::uint64_t fc_greg[13];
+ stack_t fc_stack;
+ fp_t fc_fp;
+
+ fcontext_t() :
+ fc_greg(),
+ fc_stack(),
+ fc_fp()
+ {}
+};
+
+}
+
+}}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif // BOOST_CTX_DETAIL_FCONTEXT_MIPS_H
diff --git a/boost/context/detail/fcontext_ppc.hpp b/boost/context/detail/fcontext_ppc.hpp
new file mode 100644
index 0000000000..5e6c64c555
--- /dev/null
+++ b/boost/context/detail/fcontext_ppc.hpp
@@ -0,0 +1,70 @@
+
+// Copyright Oliver Kowalke 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CTX_DETAIL_FCONTEXT_PPC_H
+#define BOOST_CTX_DETAIL_FCONTEXT_PPC_H
+
+#include <boost/config.hpp>
+#include <boost/cstdint.hpp>
+
+#include <boost/context/detail/config.hpp>
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost {
+namespace ctx {
+
+extern "C" {
+
+#define BOOST_CONTEXT_CALLDECL
+
+struct stack_t
+{
+ void * base;
+ void * limit;
+
+ stack_t() :
+ base( 0), limit( 0)
+ {}
+};
+
+struct fp_t
+{
+ boost::uint64_t fc_freg[19];
+
+ fp_t() :
+ fc_freg()
+ {}
+};
+
+struct fcontext_t
+{
+# if defined(__powerpc64__)
+ boost::uint64_t fc_greg[23];
+# else
+ boost::uint32_t fc_greg[23];
+# endif
+ stack_t fc_stack;
+ fp_t fc_fp;
+
+ fcontext_t() :
+ fc_greg(),
+ fc_stack(),
+ fc_fp()
+ {}
+};
+
+}
+
+}}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif // BOOST_CTX_DETAIL_FCONTEXT_PPC_H
diff --git a/boost/context/detail/fcontext_x86_64.hpp b/boost/context/detail/fcontext_x86_64.hpp
new file mode 100644
index 0000000000..106ee74065
--- /dev/null
+++ b/boost/context/detail/fcontext_x86_64.hpp
@@ -0,0 +1,66 @@
+
+// Copyright Oliver Kowalke 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CTX_DETAIL_FCONTEXT_X86_64_H
+#define BOOST_CTX_DETAIL_FCONTEXT_X86_64_H
+
+#include <boost/config.hpp>
+#include <boost/cstdint.hpp>
+
+#include <boost/context/detail/config.hpp>
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost {
+namespace ctx {
+
+extern "C" {
+
+#define BOOST_CONTEXT_CALLDECL
+
+struct stack_t
+{
+ void * base;
+ void * limit;
+
+ stack_t() :
+ base( 0), limit( 0)
+ {}
+};
+
+struct fp_t
+{
+ boost::uint32_t fc_freg[2];
+
+ fp_t() :
+ fc_freg()
+ {}
+};
+
+struct fcontext_t
+{
+ boost::uint64_t fc_greg[8];
+ stack_t fc_stack;
+ fp_t fc_fp;
+
+ fcontext_t() :
+ fc_greg(),
+ fc_stack(),
+ fc_fp()
+ {}
+};
+
+}
+
+}}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#endif // BOOST_CTX_DETAIL_FCONTEXT_X86_64_H
diff --git a/boost/context/detail/fcontext_x86_64_win.hpp b/boost/context/detail/fcontext_x86_64_win.hpp
new file mode 100644
index 0000000000..96f153b8e2
--- /dev/null
+++ b/boost/context/detail/fcontext_x86_64_win.hpp
@@ -0,0 +1,90 @@
+
+// Copyright Oliver Kowalke 2009.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_CTX_DETAIL_FCONTEXT_X86_64_H
+#define BOOST_CTX_DETAIL_FCONTEXT_X86_64_H
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <boost/assert.hpp>
+#include <boost/config.hpp>
+#include <boost/cstdint.hpp>
+
+#include <boost/context/detail/config.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(push)
+#pragma warning(disable:4351)
+#endif
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_PREFIX
+#endif
+
+namespace boost {
+namespace ctx {
+
+extern "C" {
+
+#define BOOST_CONTEXT_CALLDECL
+
+struct stack_t
+{
+ void * base;
+ void * limit;
+
+ stack_t() :
+ base( 0), limit( 0)
+ {}
+};
+
+struct fp_t
+{
+ boost::uint32_t fc_freg[2];
+ void * fc_xmm;
+ char fc_buffer[175];
+
+ fp_t() :
+ fc_freg(),
+ fc_xmm( 0),
+ fc_buffer()
+ {
+ fc_xmm = fc_buffer;
+ if ( 0 != ( ( ( uintptr_t) fc_xmm) & 15) )
+ fc_xmm = ( char *) ( ( ( ( uintptr_t) fc_xmm) + 15) & ~0x0F);
+ }
+};
+
+struct fcontext_t
+{
+ boost::uint64_t fc_greg[10];
+ stack_t fc_stack;
+ void * fc_local_storage;
+ fp_t fc_fp;
+
+ fcontext_t() :
+ fc_greg(),
+ fc_stack(),
+ fc_local_storage( 0),
+ fc_fp()
+ {}
+};
+
+}
+
+}}
+
+#ifdef BOOST_HAS_ABI_HEADERS
+# include BOOST_ABI_SUFFIX
+#endif
+
+#if defined(BOOST_MSVC)
+#pragma warning(pop)
+#endif
+
+#endif // BOOST_CTX_DETAIL_FCONTEXT_X86_64_H