add-ons/kernel: add casts when calling atomic_*()

Soon GCC is going to be a bit stricter about the type of pointer passed
to atomic_*() functions.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
os/support: implement atomic_*() using GCC builtin helpers

If GCC knows what these functions are actually doing the resulting
code can be optimized better what is especially noticeable in case of
invocations of atomic_{or,and}() that ignore the result. Obviously,
everything is inlined what also improves performance.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
os/arch: implement all atomic_*() using std::atomic<>

Time to get rid of some asm code. Surprisingly, it appears that
on x86[_64] the emitted code for atomic_test_and_get() isn't as efficient
as it could be, even with -O2, but cmpxchg is so expensive that this slight
difference shouldn't matter much.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
kernel, libroot: use C++11 atomics in atomic_*()

The less assembler in our sources the better. These functions wouldn't
be used very much since SupportDef.h inlines them, but the symbols should
be available.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
build: remove B_USE_BUILTIN_ATOMIC_FUNCTIONS

No reason not to use GCC atomic support on non-x86 archs.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>
libroot: remove ATOMIC_FUNCS_ARE_SYSCALLS

GCC knows whether these functions need to be implemented using syscalls
(or more clever solutions like in Linux) and calls libgcc in such case.

Signed-off-by: Paweł Dziepak <pdziepak@quarnos.org>