155cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org/*
255cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
355cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org *
455cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org *  Use of this source code is governed by a BSD-style license
555cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org *  that can be found in the LICENSE file in the root of the source
655cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org *  tree. An additional intellectual property rights grant can be found
755cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org *  in the file PATENTS.  All contributing project authors may
855cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org *  be found in the AUTHORS file in the root of the source tree.
955cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org */
1055cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org
11d56d68cd272783ae0cfe11834c2a141ec62519c2kjellander#ifndef WEBRTC_SYSTEM_WRAPPERS_INCLUDE_ASM_DEFINES_H_
12d56d68cd272783ae0cfe11834c2a141ec62519c2kjellander#define WEBRTC_SYSTEM_WRAPPERS_INCLUDE_ASM_DEFINES_H_
1355cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org
147877b0f6d2f2ddbe3bdd232177fd948860c1656akma@webrtc.org#if defined(__linux__) && defined(__ELF__)
157877b0f6d2f2ddbe3bdd232177fd948860c1656akma@webrtc.org.section .note.GNU-stack,"",%progbits
167877b0f6d2f2ddbe3bdd232177fd948860c1656akma@webrtc.org#endif
177877b0f6d2f2ddbe3bdd232177fd948860c1656akma@webrtc.org
1855cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org// Define the macros used in ARM assembly code, so that for Mac or iOS builds
1955cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org// we add leading underscores for the function names.
2055cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org#ifdef __APPLE__
2155cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org.macro GLOBAL_FUNCTION name
2255cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org.global _\name
23a3823e29a2b0b8e82946dcefa60b4187660965f4andrew@webrtc.org.private_extern _\name
2455cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org.endm
2555cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org.macro DEFINE_FUNCTION name
2655cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org_\name:
2755cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org.endm
28478291157282e87c261cc1f7351dc53c60184365kma@webrtc.org.macro CALL_FUNCTION name
29478291157282e87c261cc1f7351dc53c60184365kma@webrtc.orgbl _\name
30478291157282e87c261cc1f7351dc53c60184365kma@webrtc.org.endm
3116d540eff1587bcfad1d91d8dd5ee746fc9fad95kma@webrtc.org.macro GLOBAL_LABEL name
3216d540eff1587bcfad1d91d8dd5ee746fc9fad95kma@webrtc.org.global _\name
33a3823e29a2b0b8e82946dcefa60b4187660965f4andrew@webrtc.org.private_extern _\name
3416d540eff1587bcfad1d91d8dd5ee746fc9fad95kma@webrtc.org.endm
3555cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org#else
3655cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org.macro GLOBAL_FUNCTION name
3755cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org.global \name
38a3823e29a2b0b8e82946dcefa60b4187660965f4andrew@webrtc.org.hidden \name
3955cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org.endm
4055cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org.macro DEFINE_FUNCTION name
4180154f6b28f49399f34bc932f54c433856afa840Wei Zhong#if defined(__linux__) && defined(__ELF__)
4280154f6b28f49399f34bc932f54c433856afa840Wei Zhong.type \name,%function
4380154f6b28f49399f34bc932f54c433856afa840Wei Zhong#endif
4455cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org\name:
4555cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org.endm
46478291157282e87c261cc1f7351dc53c60184365kma@webrtc.org.macro CALL_FUNCTION name
47478291157282e87c261cc1f7351dc53c60184365kma@webrtc.orgbl \name
48478291157282e87c261cc1f7351dc53c60184365kma@webrtc.org.endm
4916d540eff1587bcfad1d91d8dd5ee746fc9fad95kma@webrtc.org.macro GLOBAL_LABEL name
5016d540eff1587bcfad1d91d8dd5ee746fc9fad95kma@webrtc.org.global \name
51a3823e29a2b0b8e82946dcefa60b4187660965f4andrew@webrtc.org.hidden \name
5216d540eff1587bcfad1d91d8dd5ee746fc9fad95kma@webrtc.org.endm
5355cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org#endif
5455cd78cfc25f135149b780dcf527d147d5621ba2kma@webrtc.org
55a0936a6e455b4b21c5ff763aac84db8fc74057ffkma@webrtc.org// With Apple's clang compiler, for instructions ldrb, strh, etc.,
562f9bd247ad201d300fe11208efe3c1397f081fc8kma@webrtc.org// the condition code is after the width specifier. Here we define
572f9bd247ad201d300fe11208efe3c1397f081fc8kma@webrtc.org// only the ones that are actually used in the assembly files.
58a0936a6e455b4b21c5ff763aac84db8fc74057ffkma@webrtc.org#if (defined __llvm__) && (defined __APPLE__)
592f9bd247ad201d300fe11208efe3c1397f081fc8kma@webrtc.org.macro streqh reg1, reg2, num
602f9bd247ad201d300fe11208efe3c1397f081fc8kma@webrtc.orgstrheq \reg1, \reg2, \num
612f9bd247ad201d300fe11208efe3c1397f081fc8kma@webrtc.org.endm
622f9bd247ad201d300fe11208efe3c1397f081fc8kma@webrtc.org#endif
632f9bd247ad201d300fe11208efe3c1397f081fc8kma@webrtc.org
647877b0f6d2f2ddbe3bdd232177fd948860c1656akma@webrtc.org.text
657877b0f6d2f2ddbe3bdd232177fd948860c1656akma@webrtc.org
66d56d68cd272783ae0cfe11834c2a141ec62519c2kjellander#endif  // WEBRTC_SYSTEM_WRAPPERS_INCLUDE_ASM_DEFINES_H_
67