History log of /freebsd-12.1/sys/sys/stdatomic.h (Results 1 – 12 of 12)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: release/12.2.0, release/11.4.0, release/12.1.0, release/11.3.0, release/12.0.0
# d2aec971 06-Aug-2018 John Baldwin <[email protected]>

Make the system C11 atomics headers fully compatible with external GCC.

The <sys/cdefs.h> and <stdatomic.h> headers already included support for
C11 atomics via intrinsincs in modern versions of GCC

Make the system C11 atomics headers fully compatible with external GCC.

The <sys/cdefs.h> and <stdatomic.h> headers already included support for
C11 atomics via intrinsincs in modern versions of GCC, but these versions
tried to "hide" atomic variables inside a wrapper structure. This wrapper
is not compatible with GCC's internal <stdatomic.h> header, so that if
GCC's <stdatomic.h> was used together with <sys/cdefs.h>, use of C11
atomics would fail to compile. Fix this by not hiding atomic variables
in a structure for modern versions of GCC. The headers already avoid
using a wrapper structure on clang.

Note that this wrapper was only used if C11 was not enabled (e.g.
via -std=c99), so this also fixes compile failures if a modern version
of GCC was used with -std=c11 but with FreeBSD's <stdatomic.h> instead
of GCC's <stdatomic.h> and this change fixes that case as well.

Reported by: Mark Millard
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D16585

show more ...


Revision tags: release/11.2.0
# c4e20cad 27-Nov-2017 Pedro F. Giffuni <[email protected]>

sys/sys: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error

sys/sys: further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

show more ...


Revision tags: release/10.4.0, release/11.1.0, release/11.0.1, release/11.0.0, release/10.3.0, release/10.2.0, release/10.1.0, release/9.3.0
# 0a4c54d6 01-Apr-2014 Tijl Coosemans <[email protected]>

Rename __wchar_t so it no longer conflicts with __wchar_t from clang 3.4
-fms-extensions.

MFC after: 2 weeks


Revision tags: release/10.0.0, release/9.2.0
# ce158c1c 18-Aug-2013 Tijl Coosemans <[email protected]>

Change the return type of the fallback implementation of the
atomic_compare_exchange_* macros in stdatomic.h to _Bool.


# e0380875 17-Aug-2013 Ed Maste <[email protected]>

Correct implementation of atomic_flag_test_and_set

The function sets the flag and returns the previous value (7.17.8.1).


# 70f53637 30-Jun-2013 Ed Schouten <[email protected]>

Make atomic_fetch_add() and atomic_fetch_sub() work for pointers with GCC 4.2.

According to the standard, atomic_fetch_*() has to behave identical to
regular arithmetic. This means that for pointer

Make atomic_fetch_add() and atomic_fetch_sub() work for pointers with GCC 4.2.

According to the standard, atomic_fetch_*() has to behave identical to
regular arithmetic. This means that for pointer types, we have to apply
the stride when doing addition/subtraction.

The GCC documentation seems to imply this is done for __sync_*() as
well. Unfortunately, both tests and Googling seems to reveal this is not
really the case. Fix this by performing the multiplication with the
stride manually.

show more ...


# 1488e633 30-Jun-2013 Ed Schouten <[email protected]>

Make various fixes to <stdatomic.h>.

- According to the standard, memory_order is a type. Use a typedef.

- atomic_*_fence() and atomic_flag_*() are described by the standard as
functions. Use inl

Make various fixes to <stdatomic.h>.

- According to the standard, memory_order is a type. Use a typedef.

- atomic_*_fence() and atomic_flag_*() are described by the standard as
functions. Use inline functions to implement them.

- Only expose the atomic_*_explicit() functions in kernel space. We
should not use the short-hand functions, as they will always use
memory_order_seq_cst.

show more ...


# cdfc5862 16-Jun-2013 Ed Schouten <[email protected]>

Move _Atomic() into <sys/cdefs.h>.

That way _Atomic() is defined next to all the other C11 keywords for
which we provide compatibility for pre-C11 compilers. While there, fix
the definition to place

Move _Atomic() into <sys/cdefs.h>.

That way _Atomic() is defined next to all the other C11 keywords for
which we provide compatibility for pre-C11 compilers. While there, fix
the definition to place "volatile" at the end. Otherwise pointer types
will become "volatile T *" instead of "T * volatile".

show more ...


# 87d2d359 13-Jun-2013 Ed Schouten <[email protected]>

Minor improvements to <stdatomic.h>.

- Define __SYNC_ATOMICS in case we're using the __sync_*() API. This is
not used by <stdatomic.h> itself, but may be useful for some of the
intrinsics code t

Minor improvements to <stdatomic.h>.

- Define __SYNC_ATOMICS in case we're using the __sync_*() API. This is
not used by <stdatomic.h> itself, but may be useful for some of the
intrinsics code to determine whether it should build the
machine-dependent intrinsic functions.

- Make is_lock_free() work in kernelspace. For now, assume atomics in
kernelspace are always lock free. This is a quite reasonable
assumption, as we surely shouldn't implement the atomic fallbacks for
arbitrary sizes.

show more ...


# 63305ba9 09-Jun-2013 Ed Schouten <[email protected]>

Fix the way atomic_is_lock_free() is defined for Clang.

When using Clang atomics, atomic types are not placed in a structure.
There is thus no reason why we should get the __val member.


# 6e872721 03-Jun-2013 Ed Schouten <[email protected]>

Add ATOMIC_*_LOCK_FREE constants.

These constants are part of the C standard. Both Clang and GCC seem to
export these constants under the name __GCC_ATOMIC_*_LOCK_FREE.


Revision tags: release/8.4.0
# 06bee445 01-Jun-2013 Ed Schouten <[email protected]>

Move <stdatomic.h> into sys/sys/.

This will allow us to use C11 atomics in kernelspace, although it will
need to be included as <sys/stdatomic.h>.