| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Notes:
svn path=/head/; revision=365223
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=337399
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/head/; revision=326256
|
|
|
|
|
|
|
|
|
| |
-fms-extensions.
MFC after: 2 weeks
Notes:
svn path=/head/; revision=263998
|
|
|
|
|
|
|
| |
atomic_compare_exchange_* macros in stdatomic.h to _Bool.
Notes:
svn path=/head/; revision=254497
|
|
|
|
|
|
|
| |
The function sets the flag and returns the previous value (7.17.8.1).
Notes:
svn path=/head/; revision=254465
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/head/; revision=252413
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
Notes:
svn path=/head/; revision=252411
|
|
|
|
|
|
|
|
|
|
| |
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".
Notes:
svn path=/head/; revision=251804
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
Notes:
svn path=/head/; revision=251694
|
|
|
|
|
|
|
|
| |
When using Clang atomics, atomic types are not placed in a structure.
There is thus no reason why we should get the __val member.
Notes:
svn path=/head/; revision=251566
|
|
|
|
|
|
|
|
| |
These constants are part of the C standard. Both Clang and GCC seem to
export these constants under the name __GCC_ATOMIC_*_LOCK_FREE.
Notes:
svn path=/head/; revision=251347
|
|
This will allow us to use C11 atomics in kernelspace, although it will
need to be included as <sys/stdatomic.h>.
Notes:
svn path=/head/; revision=251230
|