core/minute-ia: add Zephyr compatible atomic functions
core/minute-ia: add Zephyr compatible atomic functions

Add atomic functions with prototypes equal to the ones in Zephyr.

It is done as a part of porting to Zephyr, the next step is to use in
the code atomic_* instead of deprecated_atomic_*.

Some atomic functions in Zephyr return a value e.g. atomic_add - it
returns the value of the variable before the add operation.
The current state of ATOMIC_OP macro is not designed to return such value
so instead of reworking it or writing new custom asm code just use
builtin functions.

The __atomic_* builtins support variables with different sizes so use
them in *_u8 functions as well.
For "and" operation, it compiles to "andb" for u8 and to "andl" for u32.

BUG=b:169151160
BRANCH=none
TEST=buildall

Signed-off-by: Dawid Niedzwiecki <73bc8c219b84b29e82d4338ec2e55b540c845bc6@semihalf.com>
Change-Id: I498ca3dbb14aea6afc2f7a525c530eede7f31fe2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2448497
Reviewed-by: Jett Rink <9d4aef0593e6843318d99df31597fb6153b89787@chromium.org>

coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec