summaryrefslogtreecommitdiff
path: root/core/riscv-rv32i/atomic.h
diff options
context:
space:
mode:
authorDawid Niedzwiecki <dn@semihalf.com>2021-11-24 08:22:04 +0100
committerCommit Bot <commit-bot@chromium.org>2021-11-24 19:37:19 +0000
commit205d6dfafa8078aeddc797f610997545291ba679 (patch)
treec22ffc327e2efb59d77a8809d6af87b3031683dc /core/riscv-rv32i/atomic.h
parentf53a684921dbf7a0a1e915ddc266797cd2a63dd1 (diff)
downloadchrome-ec-205d6dfafa8078aeddc797f610997545291ba679.tar.gz
atomic: extract atomic_t to a separated file
Move the atomic_t definition to a separated file, common for all cores. It will be useful for removing include loops in incoming commits related to modifying atomic_t caused by a change in Zephyr upstream (atomic_t from int to long). For Zephyr, just include atomic.h which doesn't have any dependencies. BUG=b:207082842 TEST=make buildall && zmake testall && build_compare.sh -b all BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I80910c03051cf8bb46ef79350aed2a510b65c420 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3295567 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'core/riscv-rv32i/atomic.h')
-rw-r--r--core/riscv-rv32i/atomic.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/core/riscv-rv32i/atomic.h b/core/riscv-rv32i/atomic.h
index e92beb2ca0..91658e8065 100644
--- a/core/riscv-rv32i/atomic.h
+++ b/core/riscv-rv32i/atomic.h
@@ -8,13 +8,11 @@
#ifndef __CROS_EC_ATOMIC_H
#define __CROS_EC_ATOMIC_H
+#include "atomic_t.h"
#include "common.h"
#include "cpu.h"
#include "task.h"
-typedef int atomic_t;
-typedef atomic_t atomic_val_t;
-
static inline atomic_val_t atomic_clear_bits(atomic_t *addr, atomic_val_t bits)
{
return __atomic_fetch_and(addr, ~bits, __ATOMIC_SEQ_CST);