brintos

brintos / llvm-project-archived public Read only

0
0
Text · 973 B · dd06e71 Raw
36 lines · plain
1//===-- sync_synchronize - Implement memory barrier * ----------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#include "../assembly.h"10 11// When compiling a use of the gcc built-in __sync_synchronize() in thumb1 mode12// the compiler may emit a call to __sync_synchronize.13// On Darwin the implementation jumps to an OS supplied function named14// OSMemoryBarrier15 16	.text17	.syntax unified18 19#if __APPLE__20 21	.p2align 222DEFINE_COMPILERRT_PRIVATE_FUNCTION(__sync_synchronize)23	stmfd	sp!, {r7, lr}24	add		r7, sp, #025	bl		_OSMemoryBarrier26	ldmfd	sp!, {r7, pc}27END_COMPILERRT_FUNCTION(__sync_synchronize)28 29	// tell linker it can break up file at label boundaries30	.subsections_via_symbols31 32#endif33 34NO_EXEC_STACK_DIRECTIVE35 36