summaryrefslogtreecommitdiff
path: root/zephyr/shim/include/atomic.h
blob: f3efe18fe89b646fc5f2a1b65a52210506c1d437 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* Copyright 2020 The Chromium OS Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef __CROS_EC_ATOMIC_H
#define __CROS_EC_ATOMIC_H

#include <sys/atomic.h>

static inline void atomic_clear_bits(atomic_t *addr, atomic_val_t bits)
{
	atomic_and(addr, ~bits);
}

static inline atomic_val_t atomic_read_clear(atomic_t *addr)
{
	return atomic_clear(addr);
}

#endif  /* __CROS_EC_ATOMIC_H */