aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/__libunwind_config.h39
-rw-r--r--include/libunwind.h4
2 files changed, 41 insertions, 2 deletions
diff --git a/include/__libunwind_config.h b/include/__libunwind_config.h
index 63393d3058e8..099d133e744b 100644
--- a/include/__libunwind_config.h
+++ b/include/__libunwind_config.h
@@ -17,4 +17,43 @@
#define _LIBUNWIND_ARM_EHABI 0
#endif
+#if defined(_LIBUNWIND_IS_NATIVE_ONLY)
+# if defined(__i386__)
+# define _LIBUNWIND_TARGET_I386 1
+# define _LIBUNWIND_CONTEXT_SIZE 8
+# define _LIBUNWIND_CURSOR_SIZE 19
+# elif defined(__x86_64__)
+# define _LIBUNWIND_TARGET_X86_64 1
+# define _LIBUNWIND_CONTEXT_SIZE 21
+# define _LIBUNWIND_CURSOR_SIZE 33
+# elif defined(__ppc__)
+# define _LIBUNWIND_TARGET_PPC 1
+# define _LIBUNWIND_CONTEXT_SIZE 117
+# define _LIBUNWIND_CURSOR_SIZE 128
+# elif defined(__aarch64__)
+# define _LIBUNWIND_TARGET_AARCH64 1
+# define _LIBUNWIND_CONTEXT_SIZE 66
+# define _LIBUNWIND_CURSOR_SIZE 78
+# elif defined(__arm__)
+# define _LIBUNWIND_TARGET_ARM 1
+# define _LIBUNWIND_CONTEXT_SIZE 60
+# define _LIBUNWIND_CURSOR_SIZE 67
+# elif defined(__or1k__)
+# define _LIBUNWIND_TARGET_OR1K 1
+# define _LIBUNWIND_CONTEXT_SIZE 16
+# define _LIBUNWIND_CURSOR_SIZE 28
+# else
+# error "Unsupported architecture."
+# endif
+#else // !_LIBUNWIND_IS_NATIVE_ONLY
+# define _LIBUNWIND_TARGET_I386 1
+# define _LIBUNWIND_TARGET_X86_64 1
+# define _LIBUNWIND_TARGET_PPC 1
+# define _LIBUNWIND_TARGET_AARCH64 1
+# define _LIBUNWIND_TARGET_ARM 1
+# define _LIBUNWIND_TARGET_OR1K 1
+# define _LIBUNWIND_CONTEXT_SIZE 128
+# define _LIBUNWIND_CURSOR_SIZE 140
+#endif // _LIBUNWIND_IS_NATIVE_ONLY
+
#endif // ____LIBUNWIND_CONFIG_H__
diff --git a/include/libunwind.h b/include/libunwind.h
index 6045becc01aa..c5b9633b1506 100644
--- a/include/libunwind.h
+++ b/include/libunwind.h
@@ -46,12 +46,12 @@ enum {
};
struct unw_context_t {
- uint64_t data[128];
+ uint64_t data[_LIBUNWIND_CONTEXT_SIZE];
};
typedef struct unw_context_t unw_context_t;
struct unw_cursor_t {
- uint64_t data[140];
+ uint64_t data[_LIBUNWIND_CURSOR_SIZE];
};
typedef struct unw_cursor_t unw_cursor_t;