Sound Open Firmware
Loading...
Searching...
No Matches
atomic.h
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-3-Clause
2//
3// Copyright(c) 2020 Intel Corporation. All rights reserved.
4//
5
6#ifndef __ZEPHYR_RTOS_ATOMIC_H__
7#define __ZEPHYR_RTOS_ATOMIC_H__
8
9#include <zephyr/sys/atomic.h>
10
11/* Zephyr commit 174cb7f9f183 switched 'atomic_t' from 'int' to
12 * 'long'. As we don't support 64 bits, this should have made no
13 * difference but in reality it broke printk("%d / %ld",...) The no-op
14 * cast to 'long' below provides a transition by making it possible to
15 * compile SOF both before _and_ after the Zephyr switch.
16 */
17#define atomic_read(p) ((long)atomic_get(p))
18#define atomic_init(p, v) atomic_set(p, v)
19
20#endif /*__ZEPHYR_RTOS_ATOMIC_H__ */