summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Raghavan <git@arunraghavan.net>2015-10-19 11:32:48 +0530
committerArun Raghavan <git@arunraghavan.net>2015-10-19 11:32:48 +0530
commit2f0b9411d357ad73b19308efdd22c84bd767ea90 (patch)
treeb6d40f039f7b06b2b5c73748e4c1de6a2b1d0e64
parentd6a338cb01e4214fe236363f35438d1f8b822696 (diff)
system_wrappers: Add missing file for ARM builds
-rw-r--r--webrtc/system_wrappers/Makefile.am1
-rw-r--r--webrtc/system_wrappers/interface/asm_defines.h66
2 files changed, 67 insertions, 0 deletions
diff --git a/webrtc/system_wrappers/Makefile.am b/webrtc/system_wrappers/Makefile.am
index 552d0a1..fb47a3d 100644
--- a/webrtc/system_wrappers/Makefile.am
+++ b/webrtc/system_wrappers/Makefile.am
@@ -1,6 +1,7 @@
noinst_LTLIBRARIES = libsystem_wrappers.la
noinst_HEADERS = interface/aligned_array.h \
+ interface/asm_defines.h \
interface/compile_assert_c.h \
interface/event_wrapper.h \
interface/scoped_vector.h \
diff --git a/webrtc/system_wrappers/interface/asm_defines.h b/webrtc/system_wrappers/interface/asm_defines.h
new file mode 100644
index 0000000..c2a688f
--- /dev/null
+++ b/webrtc/system_wrappers/interface/asm_defines.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ASM_DEFINES_H_
+#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ASM_DEFINES_H_
+
+#if defined(__linux__) && defined(__ELF__)
+.section .note.GNU-stack,"",%progbits
+#endif
+
+// Define the macros used in ARM assembly code, so that for Mac or iOS builds
+// we add leading underscores for the function names.
+#ifdef __APPLE__
+.macro GLOBAL_FUNCTION name
+.global _\name
+.private_extern _\name
+.endm
+.macro DEFINE_FUNCTION name
+_\name:
+.endm
+.macro CALL_FUNCTION name
+bl _\name
+.endm
+.macro GLOBAL_LABEL name
+.global _\name
+.private_extern _\name
+.endm
+#else
+.macro GLOBAL_FUNCTION name
+.global \name
+.hidden \name
+.endm
+.macro DEFINE_FUNCTION name
+#if defined(__linux__) && defined(__ELF__)
+.type \name,%function
+#endif
+\name:
+.endm
+.macro CALL_FUNCTION name
+bl \name
+.endm
+.macro GLOBAL_LABEL name
+.global \name
+.hidden \name
+.endm
+#endif
+
+// With Apple's clang compiler, for instructions ldrb, strh, etc.,
+// the condition code is after the width specifier. Here we define
+// only the ones that are actually used in the assembly files.
+#if (defined __llvm__) && (defined __APPLE__)
+.macro streqh reg1, reg2, num
+strheq \reg1, \reg2, \num
+.endm
+#endif
+
+.text
+
+#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ASM_DEFINES_H_