1 //===-- sync_synchronize - Implement memory barrier * ----------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 #include "../assembly.h" 11 12 // 13 // When compiling a use of the gcc built-in __sync_synchronize() in thumb1 mode 14 // the compiler may emit a call to __sync_synchronize. 15 // On Darwin the implementation jumps to an OS supplied function named 16 // OSMemoryBarrier 17 // 18 19 .text 20 .syntax unified 21 22 #if __APPLE__ 23 24 DEFINE_COMPILERRT_PRIVATE_FUNCTION(__sync_synchronize) 25 stmfd sp!, {r7, lr} 26 add r7, sp, #0 27 bl _OSMemoryBarrier 28 ldmfd sp!, {r7, pc} 29 30 // tell linker it can break up file at label boundaries 31 .subsections_via_symbols 32 33 #endif 34