summaryrefslogtreecommitdiffstats
path: root/libunwind/src/assembly.h
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2015-04-24 19:39:17 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2015-04-24 19:39:17 +0000
commitb1b1911777d3516fab27ce1461fdc39fe372bf6f (patch)
tree08e05b7d3cac64b47f40748770e11abaf6fef95b /libunwind/src/assembly.h
parentcb6b6f7e20bc169cdf6d768f740f8efae66edc8b (diff)
downloadbcm5719-llvm-b1b1911777d3516fab27ce1461fdc39fe372bf6f.tar.gz
bcm5719-llvm-b1b1911777d3516fab27ce1461fdc39fe372bf6f.zip
unwind: move src/Unwind, include/, and test/ unwind content
This moves the majority of the unwind sources into the new project layout for libunwind. This was previously discussed on llvmdev at [1]. This is a purely movement related change, with the build infrastructure currently still residing in the libc++abi repository. [1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-January/081507.html llvm-svn: 235758
Diffstat (limited to 'libunwind/src/assembly.h')
-rw-r--r--libunwind/src/assembly.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/libunwind/src/assembly.h b/libunwind/src/assembly.h
new file mode 100644
index 00000000000..f46a24d0eed
--- /dev/null
+++ b/libunwind/src/assembly.h
@@ -0,0 +1,80 @@
+/* ===-- assembly.h - libUnwind assembler support macros -------------------===
+ *
+ * The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ * ===----------------------------------------------------------------------===
+ *
+ * This file defines macros for use in libUnwind assembler source.
+ * This file is not part of the interface of this library.
+ *
+ * ===----------------------------------------------------------------------===
+ */
+
+#ifndef UNWIND_ASSEMBLY_H
+#define UNWIND_ASSEMBLY_H
+
+#if defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__)
+#define SEPARATOR @
+#elif defined(__arm64__)
+#define SEPARATOR %%
+#else
+#define SEPARATOR ;
+#endif
+
+#if defined(__APPLE__)
+#define HIDDEN_DIRECTIVE .private_extern
+#else
+#define HIDDEN_DIRECTIVE .hidden
+#endif
+
+#define GLUE2(a, b) a ## b
+#define GLUE(a, b) GLUE2(a, b)
+#define SYMBOL_NAME(name) GLUE(__USER_LABEL_PREFIX__, name)
+
+#if defined(__APPLE__)
+#define SYMBOL_IS_FUNC(name)
+#elif defined(__ELF__)
+#if defined(__arm__)
+#define SYMBOL_IS_FUNC(name) .type name,%function
+#else
+#define SYMBOL_IS_FUNC(name) .type name,@function
+#endif
+#else
+#define SYMBOL_IS_FUNC(name) \
+ .def name SEPARATOR \
+ .scl 2 SEPARATOR \
+ .type 32 SEPARATOR \
+ .endef
+#endif
+
+#define DEFINE_LIBUNWIND_FUNCTION(name) \
+ .globl SYMBOL_NAME(name) SEPARATOR \
+ SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \
+ SYMBOL_NAME(name):
+
+#define DEFINE_LIBUNWIND_PRIVATE_FUNCTION(name) \
+ .globl SYMBOL_NAME(name) SEPARATOR \
+ HIDDEN_DIRECTIVE SYMBOL_NAME(name) SEPARATOR \
+ SYMBOL_IS_FUNC(SYMBOL_NAME(name)) SEPARATOR \
+ SYMBOL_NAME(name):
+
+#if defined(__arm__)
+#if !defined(__ARM_ARCH)
+#define __ARM_ARCH 4
+#endif
+
+#if defined(__ARM_ARCH_4T__) || __ARM_ARCH >= 5
+#define ARM_HAS_BX
+#endif
+
+#ifdef ARM_HAS_BX
+#define JMP(r) bx r
+#else
+#define JMP(r) mov pc, r
+#endif
+#endif /* __arm__ */
+
+#endif /* UNWIND_ASSEMBLY_H */
OpenPOWER on IntegriCloud