Improve atomic memory access and support -mno-atomic.

Use CONFIG_GENERIC_ATOMIC64 if 32-bit.  Add system call to emulate
atomic compare exchange, primarily for targets lacking hardware
support (i.e., lacking RV32A, RV64A).  Support excluding use of
atomic memory instructions (-mno-atomic).

This change is mutually dependent on the corresponding change to
riscv-gcc.
On 08/16/2014 02:02 AM, Albert Ou wrote:
> In arch/riscv/include/asm/syscalls.h:
> 
>> @@ -0,0 +1,13 @@
>> +#ifndef _ASM_RISCV_SYSCALLS_H
> 
> Remember to remove |syscalls.h| from the |generic-y| list in
> arch/riscv/include/asm/Kbuild, as should be done whenever an
> arch-specific header replaces its generic counterpart. This would
> suppress unnecessary header file generation.
> 
> Although Kbuild's include path ordering currently prevents any
> interference by the duplicate header, it would be safer not to rely such
> specific (if accidental) behavior by the build system.
> 

Ok, understood.

// darius