2010-02-03 05:34:04 +08:00
|
|
|
//===-- sync_synchronize - Implement memory barrier * ----------------------===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2010-11-17 06:13:33 +08:00
|
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
|
|
// Source Licenses. See LICENSE.TXT for details.
|
2010-02-03 05:34:04 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "../assembly.h"
|
|
|
|
|
|
|
|
//
|
|
|
|
// When compiling a use of the gcc built-in __sync_synchronize() in thumb1 mode
|
|
|
|
// the compiler may emit a call to __sync_synchronize.
|
|
|
|
// On Darwin the implementation jumps to an OS supplied function named
|
|
|
|
// OSMemoryBarrier
|
|
|
|
//
|
|
|
|
|
|
|
|
.text
|
|
|
|
.syntax unified
|
|
|
|
|
|
|
|
#if __APPLE__
|
|
|
|
|
2010-04-22 06:36:23 +08:00
|
|
|
.align 2
|
2010-02-03 05:34:04 +08:00
|
|
|
DEFINE_COMPILERRT_PRIVATE_FUNCTION(__sync_synchronize)
|
|
|
|
stmfd sp!, {r7, lr}
|
|
|
|
add r7, sp, #0
|
|
|
|
bl _OSMemoryBarrier
|
|
|
|
ldmfd sp!, {r7, pc}
|
|
|
|
|
|
|
|
// tell linker it can break up file at label boundaries
|
|
|
|
.subsections_via_symbols
|
|
|
|
|
|
|
|
#endif
|