summaryrefslogtreecommitdiff
path: root/core/cortex-m0
diff options
context:
space:
mode:
authorDawid Niedzwiecki <dn@semihalf.com>2022-03-04 11:47:37 +0100
committerCommit Bot <commit-bot@chromium.org>2022-03-09 09:49:29 +0000
commitc755fffea0e2e05733e61ea254d820612e869b7a (patch)
tree6c92d6c062de5d1d9ac16f576d34023588ee9b46 /core/cortex-m0
parent3f1fe1e185c05c8037576466d246945be385973d (diff)
downloadchrome-ec-c755fffea0e2e05733e61ea254d820612e869b7a.tar.gz
atomic: add atomic_and function
Add atomic_and functions for all cores. The functions will be used for more complex atomic operations for bits manipulating that will be merged in a following CL. BRANCH=none BUG=b:208435177 TEST=make buildall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I659ee8214206750fbe8af4df21672d8cbfc59278 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3500418 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Dawid Niedzwiecki <dawidn@google.com>
Diffstat (limited to 'core/cortex-m0')
-rw-r--r--core/cortex-m0/atomic.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/cortex-m0/atomic.h b/core/cortex-m0/atomic.h
index aef4d2a0a6..7ec856ed62 100644
--- a/core/cortex-m0/atomic.h
+++ b/core/cortex-m0/atomic.h
@@ -69,4 +69,9 @@ static inline atomic_val_t atomic_clear(atomic_t *addr)
return ret;
}
+static inline atomic_val_t atomic_and(atomic_t *addr, atomic_val_t bits)
+{
+ return ATOMIC_OP(ands, addr, bits);
+}
+
#endif /* __CROS_EC_ATOMIC_H */