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/unistd.h:
> 
>> @@ -14,8 +14,14 @@
>>  
>>  #include <asm-generic/unistd.h>
>>  
>> +#define __NR_sysriscv  __NR_arch_specific_syscall
> 
> Are there future plans to expand this system call for other purposes?
> If not, may I suggest more descriptive names, e.g., |__NR_riscv_atomic|
> and |sys_riscv_atomic|?
> 

I am not aware of future plans to expand this system call.

I picked the name to be consistent with other architectures that do
something similar to provide atomic memory access (sysmips for MIPS,
sysxtensa for Xtensa).

I would be glad to change the name to what you recommend.

// darius