[AVR32] Don't use __builtin_xchg()
[AVR32] Don't use __builtin_xchg()

The implementation of __builtin_xchg() in at least some versions of
avr32 gcc is buggy. Rather than find out exactly which versions that
have this bug, let's just avoid the problem altogether by implementing
xchg() in inline assembly.

Also, in most architectures, xchg() seems to imply a memory barrier,
while the existing avr32 implementation did not. This patch also fixes
that discrepancy.

Signed-off-by: Haavard Skinnemoen <de7418319212d7eab32260a76732c1f83e514852@atmel.com>

KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas