/* Atomic addition primitive. 
is atomically added to the value at <target>, placing the result at <target>, and the old value from <target> is returned. */
atomic_val_t z_impl_atomic_add(atomic_t *target, atomic_val_t value)
/* Atomic addition primitive. 
is atomically added to the value at <target>, placing the result at <target>, and the old value from <target> is returned. */
atomic_val_t z_impl_atomic_add(atomic_t *target, atomic_val_t value)
{
	k_spinlock_key_t key;
	atomic_val_t ret;
	key = k_spin_lock(&lock);
	ret = *target;
	*target += value;
	k_spin_unlock(&lock, key);
	return ret;
}