diff --git a/zephyr/include/sof/atomic.h b/zephyr/include/sof/atomic.h index c5a3d764a695..ceab603b3cb4 100644 --- a/zephyr/include/sof/atomic.h +++ b/zephyr/include/sof/atomic.h @@ -8,7 +8,13 @@ #include -#define atomic_read atomic_get -#define atomic_init atomic_set +/* Zephyr commit 174cb7f9f183 switched 'atomic_t' from 'int' to + * 'long'. As we don't support 64 bits, this should have made no + * difference but in reality it broke printk("%d / %ld",...) The no-op + * cast to 'long' below provides a transition by making it possible to + * compile SOF both before _and_ after the Zephyr switch. + */ +#define atomic_read(p) ((long)atomic_get(p)) +#define atomic_init(p, v) atomic_set(p, v) #endif