[CM3] Add atomic operation support

Tested with -O0, -O2 and -Os generating correct code with gcc-arm-embedded 2013q2.
note -std=c99 or newer needed