2010-02-03 05:34:04 +08:00
|
|
|
//===-- sync_synchronize - Implement memory barrier * ----------------------===//
|
|
|
|
//
|
2019-01-19 18:56:40 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
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__
|
|
|
|
|
2014-05-12 23:23:37 +08:00
|
|
|
.p2align 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}
|
2014-01-24 22:33:42 +08:00
|
|
|
END_COMPILERRT_FUNCTION(__sync_synchronize)
|
2010-02-03 05:34:04 +08:00
|
|
|
|
|
|
|
// tell linker it can break up file at label boundaries
|
|
|
|
.subsections_via_symbols
|
|
|
|
|
|
|
|
#endif
|
2016-06-23 06:09:42 +08:00
|
|
|
|
|
|
|
NO_EXEC_STACK_DIRECTIVE
|
|
|
|
|