Chris@16
|
1
|
Chris@16
|
2 // Copyright Oliver Kowalke 2009.
|
Chris@16
|
3 // Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
4 // (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
5 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
6
|
Chris@16
|
7 #ifndef BOOST_CONTEXT_FCONTEXT_H
|
Chris@16
|
8 #define BOOST_CONTEXT_FCONTEXT_H
|
Chris@16
|
9
|
Chris@16
|
10 #if defined(__PGI)
|
Chris@16
|
11 #include <stdint.h>
|
Chris@16
|
12 #endif
|
Chris@16
|
13
|
Chris@16
|
14 #if defined(_WIN32_WCE)
|
Chris@16
|
15 typedef int intptr_t;
|
Chris@16
|
16 #endif
|
Chris@16
|
17
|
Chris@16
|
18 #include <boost/config.hpp>
|
Chris@16
|
19 #include <boost/cstdint.hpp>
|
Chris@16
|
20
|
Chris@16
|
21 #include <boost/context/detail/config.hpp>
|
Chris@16
|
22
|
Chris@16
|
23 #ifdef BOOST_HAS_ABI_HEADERS
|
Chris@16
|
24 # include BOOST_ABI_PREFIX
|
Chris@16
|
25 #endif
|
Chris@16
|
26
|
Chris@16
|
27 // x86_64
|
Chris@16
|
28 // test x86_64 before i386 because icc might
|
Chris@16
|
29 // define __i686__ for x86_64 too
|
Chris@16
|
30 #if defined(__x86_64__) || defined(__x86_64) \
|
Chris@16
|
31 || defined(__amd64__) || defined(__amd64) \
|
Chris@16
|
32 || defined(_M_X64) || defined(_M_AMD64)
|
Chris@16
|
33 # if defined(BOOST_WINDOWS)
|
Chris@16
|
34 # include <boost/context/detail/fcontext_x86_64_win.hpp>
|
Chris@16
|
35 # else
|
Chris@16
|
36 # include <boost/context/detail/fcontext_x86_64.hpp>
|
Chris@16
|
37 # endif
|
Chris@16
|
38 // i386
|
Chris@16
|
39 #elif defined(i386) || defined(__i386__) || defined(__i386) \
|
Chris@16
|
40 || defined(__i486__) || defined(__i586__) || defined(__i686__) \
|
Chris@16
|
41 || defined(__X86__) || defined(_X86_) || defined(__THW_INTEL__) \
|
Chris@16
|
42 || defined(__I86__) || defined(__INTEL__) || defined(__IA32__) \
|
Chris@16
|
43 || defined(_M_IX86) || defined(_I86_)
|
Chris@16
|
44 # if defined(BOOST_WINDOWS)
|
Chris@16
|
45 # include <boost/context/detail/fcontext_i386_win.hpp>
|
Chris@16
|
46 # else
|
Chris@16
|
47 # include <boost/context/detail/fcontext_i386.hpp>
|
Chris@16
|
48 # endif
|
Chris@16
|
49 // arm
|
Chris@16
|
50 #elif defined(__arm__) || defined(__thumb__) || defined(__TARGET_ARCH_ARM) \
|
Chris@16
|
51 || defined(__TARGET_ARCH_THUMB) || defined(_ARM) || defined(_M_ARM)
|
Chris@16
|
52 # include <boost/context/detail/fcontext_arm.hpp>
|
Chris@16
|
53 // mips
|
Chris@16
|
54 #elif (defined(__mips) && __mips == 1) || defined(_MIPS_ISA_MIPS1) \
|
Chris@16
|
55 || defined(_R3000)
|
Chris@16
|
56 # include <boost/context/detail/fcontext_mips.hpp>
|
Chris@16
|
57 // powerpc
|
Chris@16
|
58 #elif defined(__powerpc) || defined(__powerpc__) || defined(__ppc) \
|
Chris@16
|
59 || defined(__ppc__) || defined(_ARCH_PPC) || defined(__POWERPC__) \
|
Chris@16
|
60 || defined(__PPCGECKO__) || defined(__PPCBROADWAY) || defined(_XENON)
|
Chris@16
|
61 # include <boost/context/detail/fcontext_ppc.hpp>
|
Chris@16
|
62 #elif defined(__sparc__) || defined(__sparc)
|
Chris@16
|
63 // sparc or sparc64
|
Chris@16
|
64 # include <boost/context/detail/fcontext_sparc.hpp>
|
Chris@16
|
65 #else
|
Chris@16
|
66 # error "platform not supported"
|
Chris@16
|
67 #endif
|
Chris@16
|
68
|
Chris@16
|
69 namespace boost {
|
Chris@16
|
70 namespace context {
|
Chris@16
|
71
|
Chris@16
|
72 extern "C" BOOST_CONTEXT_DECL
|
Chris@16
|
73 intptr_t BOOST_CONTEXT_CALLDECL jump_fcontext( fcontext_t * ofc, fcontext_t const* nfc, intptr_t vp, bool preserve_fpu = true);
|
Chris@16
|
74 extern "C" BOOST_CONTEXT_DECL
|
Chris@16
|
75 fcontext_t * BOOST_CONTEXT_CALLDECL make_fcontext( void * sp, std::size_t size, void (* fn)( intptr_t) );
|
Chris@16
|
76
|
Chris@16
|
77 }}
|
Chris@16
|
78
|
Chris@16
|
79 #ifdef BOOST_HAS_ABI_HEADERS
|
Chris@16
|
80 # include BOOST_ABI_SUFFIX
|
Chris@16
|
81 #endif
|
Chris@16
|
82
|
Chris@16
|
83 #endif // BOOST_CONTEXT_FCONTEXT_H
|
Chris@16
|
84
|