]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC: r228919
authormarius <marius@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 25 May 2012 17:50:50 +0000 (17:50 +0000)
committermarius <marius@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 25 May 2012 17:50:50 +0000 (17:50 +0000)
commit9a68ba457ffad556b140ea86da11bee92cf2bf28
tree8eb18d15673c586a1585da5d2dae8cb666ff7dd9
parentaecc122f326637ff063589e524133bfa9b88bef6
MFC: r228919

Add locally implemented atomic intrinsics to libcompiler_rt.

The built-in atomic operations are not implemented in our version of GCC
4.2 for the ARM and MIPS architectures. Instead of emitting locked
instructions, they generate calls to functions that can be implemented
in the C runtime.

Only implement the atomic operations that are used by <stdatomic.h> for
datatype sizes that are supported by atomic(9). This means that on these
architectures, we can only use atomic operations on 32-bits and 64-bits
variables, which is typically sufficient.

This makes <stdatomic.h> work on all architectures except MIPS, since
MIPS still uses libgcc.

git-svn-id: svn://svn.freebsd.org/base/stable/9@236016 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
17 files changed:
lib/libcompiler_rt/Makefile
lib/libcompiler_rt/__sync_fetch_and_add_4.c [new file with mode: 0644]
lib/libcompiler_rt/__sync_fetch_and_add_8.c [new file with mode: 0644]
lib/libcompiler_rt/__sync_fetch_and_and_4.c [new file with mode: 0644]
lib/libcompiler_rt/__sync_fetch_and_and_8.c [new file with mode: 0644]
lib/libcompiler_rt/__sync_fetch_and_op_n.h [new file with mode: 0644]
lib/libcompiler_rt/__sync_fetch_and_or_4.c [new file with mode: 0644]
lib/libcompiler_rt/__sync_fetch_and_or_8.c [new file with mode: 0644]
lib/libcompiler_rt/__sync_fetch_and_sub_4.c [new file with mode: 0644]
lib/libcompiler_rt/__sync_fetch_and_sub_8.c [new file with mode: 0644]
lib/libcompiler_rt/__sync_fetch_and_xor_4.c [new file with mode: 0644]
lib/libcompiler_rt/__sync_fetch_and_xor_8.c [new file with mode: 0644]
lib/libcompiler_rt/__sync_lock_test_and_set_4.c [new file with mode: 0644]
lib/libcompiler_rt/__sync_lock_test_and_set_8.c [new file with mode: 0644]
lib/libcompiler_rt/__sync_val_compare_and_swap_4.c [new file with mode: 0644]
lib/libcompiler_rt/__sync_val_compare_and_swap_8.c [new file with mode: 0644]
lib/libcompiler_rt/__sync_val_compare_and_swap_n.h [new file with mode: 0644]