blob: bd3caeca725910efa6a983478dc6041d57639aaf [file] [log] [blame]
kma@webrtc.org55cd78c2012-11-17 00:22:46 +00001/*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ASM_DEFINES_H_
12#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ASM_DEFINES_H_
13
kma@webrtc.org7877b0f2012-12-12 23:22:13 +000014#if defined(__linux__) && defined(__ELF__)
15.section .note.GNU-stack,"",%progbits
16#endif
17
kma@webrtc.org55cd78c2012-11-17 00:22:46 +000018// Define the macros used in ARM assembly code, so that for Mac or iOS builds
19// we add leading underscores for the function names.
20#ifdef __APPLE__
21.macro GLOBAL_FUNCTION name
22.global _\name
andrew@webrtc.orga3823e22015-03-09 23:21:25 +000023.private_extern _\name
kma@webrtc.org55cd78c2012-11-17 00:22:46 +000024.endm
25.macro DEFINE_FUNCTION name
26_\name:
27.endm
kma@webrtc.org47829112013-01-24 01:37:33 +000028.macro CALL_FUNCTION name
29bl _\name
30.endm
kma@webrtc.org16d540e2013-01-25 03:18:05 +000031.macro GLOBAL_LABEL name
32.global _\name
andrew@webrtc.orga3823e22015-03-09 23:21:25 +000033.private_extern _\name
kma@webrtc.org16d540e2013-01-25 03:18:05 +000034.endm
kma@webrtc.org55cd78c2012-11-17 00:22:46 +000035#else
36.macro GLOBAL_FUNCTION name
37.global \name
andrew@webrtc.orga3823e22015-03-09 23:21:25 +000038.hidden \name
kma@webrtc.org55cd78c2012-11-17 00:22:46 +000039.endm
40.macro DEFINE_FUNCTION name
41\name:
42.endm
kma@webrtc.org47829112013-01-24 01:37:33 +000043.macro CALL_FUNCTION name
44bl \name
45.endm
kma@webrtc.org16d540e2013-01-25 03:18:05 +000046.macro GLOBAL_LABEL name
47.global \name
andrew@webrtc.orga3823e22015-03-09 23:21:25 +000048.hidden \name
kma@webrtc.org16d540e2013-01-25 03:18:05 +000049.endm
kma@webrtc.org55cd78c2012-11-17 00:22:46 +000050#endif
51
kma@webrtc.orga0936a62013-03-01 00:20:10 +000052// With Apple's clang compiler, for instructions ldrb, strh, etc.,
kma@webrtc.org2f9bd242013-02-23 04:16:59 +000053// the condition code is after the width specifier. Here we define
54// only the ones that are actually used in the assembly files.
kma@webrtc.orga0936a62013-03-01 00:20:10 +000055#if (defined __llvm__) && (defined __APPLE__)
kma@webrtc.org2f9bd242013-02-23 04:16:59 +000056.macro streqh reg1, reg2, num
57strheq \reg1, \reg2, \num
58.endm
59#endif
60
kma@webrtc.org7877b0f2012-12-12 23:22:13 +000061.text
62
andrew@webrtc.org31628aa2013-10-22 12:50:00 +000063#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_ASM_DEFINES_H_