summaryrefslogtreecommitdiff
path: root/include/atomic_bit.h
blob: 34416a2f897ce1540a37b09b9f4046b7c8541180 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Copyright 2022 The ChromiumOS Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef __CROS_EC_ATOMIC_BIT_H
#define __CROS_EC_ATOMIC_BIT_H

#ifndef CONFIG_ZEPHYR
#include "atomic.h"

static inline atomic_val_t atomic_get(const atomic_t *target)
{
	return __atomic_load_n(target, __ATOMIC_SEQ_CST);
}

#include "third_party/zephyr/atomic.h"

#endif /* CONFIG_ZEPHYR */
#endif /* __CROS_EC_ATOMIC_BIT_H */