2020-06-23 23:43:56 +08:00
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
//
|
|
|
|
// Copyright(c) 2020 Intel Corporation. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2022-08-20 03:40:52 +08:00
|
|
|
#ifndef __ZEPHYR_RTOS_ATOMIC_H__
|
|
|
|
#define __ZEPHYR_RTOS_ATOMIC_H__
|
2020-06-23 23:43:56 +08:00
|
|
|
|
2022-08-03 20:10:25 +08:00
|
|
|
#include <zephyr/sys/atomic.h>
|
2020-06-23 23:43:56 +08:00
|
|
|
|
2021-11-18 15:03:08 +08:00
|
|
|
/* 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)
|
2020-06-23 23:43:56 +08:00
|
|
|
|
2022-08-20 03:40:52 +08:00
|
|
|
#endif /*__ZEPHYR_RTOS_ATOMIC_H__ */
|