kma@webrtc.org | 55cd78c | 2012-11-17 00:22:46 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
kjellander | d56d68c | 2015-11-02 02:12:41 -0800 | [diff] [blame] | 11 | #ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_ASM_DEFINES_H_ |
| 12 | #define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_ASM_DEFINES_H_ |
kma@webrtc.org | 55cd78c | 2012-11-17 00:22:46 +0000 | [diff] [blame] | 13 | |
kma@webrtc.org | 7877b0f | 2012-12-12 23:22:13 +0000 | [diff] [blame] | 14 | #if defined(__linux__) && defined(__ELF__) |
| 15 | .section .note.GNU-stack,"",%progbits |
| 16 | #endif |
| 17 | |
kma@webrtc.org | 55cd78c | 2012-11-17 00:22:46 +0000 | [diff] [blame] | 18 | // 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.org | a3823e2 | 2015-03-09 23:21:25 +0000 | [diff] [blame] | 23 | .private_extern _\name |
kma@webrtc.org | 55cd78c | 2012-11-17 00:22:46 +0000 | [diff] [blame] | 24 | .endm |
| 25 | .macro DEFINE_FUNCTION name |
| 26 | _\name: |
| 27 | .endm |
kma@webrtc.org | 4782911 | 2013-01-24 01:37:33 +0000 | [diff] [blame] | 28 | .macro CALL_FUNCTION name |
| 29 | bl _\name |
| 30 | .endm |
kma@webrtc.org | 16d540e | 2013-01-25 03:18:05 +0000 | [diff] [blame] | 31 | .macro GLOBAL_LABEL name |
| 32 | .global _\name |
andrew@webrtc.org | a3823e2 | 2015-03-09 23:21:25 +0000 | [diff] [blame] | 33 | .private_extern _\name |
kma@webrtc.org | 16d540e | 2013-01-25 03:18:05 +0000 | [diff] [blame] | 34 | .endm |
kma@webrtc.org | 55cd78c | 2012-11-17 00:22:46 +0000 | [diff] [blame] | 35 | #else |
| 36 | .macro GLOBAL_FUNCTION name |
| 37 | .global \name |
andrew@webrtc.org | a3823e2 | 2015-03-09 23:21:25 +0000 | [diff] [blame] | 38 | .hidden \name |
kma@webrtc.org | 55cd78c | 2012-11-17 00:22:46 +0000 | [diff] [blame] | 39 | .endm |
| 40 | .macro DEFINE_FUNCTION name |
Wei Zhong | 80154f6 | 2015-04-28 13:51:53 -0700 | [diff] [blame] | 41 | #if defined(__linux__) && defined(__ELF__) |
| 42 | .type \name,%function |
| 43 | #endif |
kma@webrtc.org | 55cd78c | 2012-11-17 00:22:46 +0000 | [diff] [blame] | 44 | \name: |
| 45 | .endm |
kma@webrtc.org | 4782911 | 2013-01-24 01:37:33 +0000 | [diff] [blame] | 46 | .macro CALL_FUNCTION name |
| 47 | bl \name |
| 48 | .endm |
kma@webrtc.org | 16d540e | 2013-01-25 03:18:05 +0000 | [diff] [blame] | 49 | .macro GLOBAL_LABEL name |
| 50 | .global \name |
andrew@webrtc.org | a3823e2 | 2015-03-09 23:21:25 +0000 | [diff] [blame] | 51 | .hidden \name |
kma@webrtc.org | 16d540e | 2013-01-25 03:18:05 +0000 | [diff] [blame] | 52 | .endm |
kma@webrtc.org | 55cd78c | 2012-11-17 00:22:46 +0000 | [diff] [blame] | 53 | #endif |
| 54 | |
kma@webrtc.org | a0936a6 | 2013-03-01 00:20:10 +0000 | [diff] [blame] | 55 | // With Apple's clang compiler, for instructions ldrb, strh, etc., |
kma@webrtc.org | 2f9bd24 | 2013-02-23 04:16:59 +0000 | [diff] [blame] | 56 | // the condition code is after the width specifier. Here we define |
| 57 | // only the ones that are actually used in the assembly files. |
kma@webrtc.org | a0936a6 | 2013-03-01 00:20:10 +0000 | [diff] [blame] | 58 | #if (defined __llvm__) && (defined __APPLE__) |
kma@webrtc.org | 2f9bd24 | 2013-02-23 04:16:59 +0000 | [diff] [blame] | 59 | .macro streqh reg1, reg2, num |
| 60 | strheq \reg1, \reg2, \num |
| 61 | .endm |
| 62 | #endif |
| 63 | |
kma@webrtc.org | 7877b0f | 2012-12-12 23:22:13 +0000 | [diff] [blame] | 64 | .text |
| 65 | |
kjellander | d56d68c | 2015-11-02 02:12:41 -0800 | [diff] [blame] | 66 | #endif // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_ASM_DEFINES_H_ |