summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorDawid Niedzwiecki <dn@semihalf.com>2020-09-24 09:20:41 +0200
committerCommit Bot <commit-bot@chromium.org>2020-10-06 09:44:48 +0000
commit32b7e8875e0a08290168ec7dda040d5a5db513fa (patch)
treec1336b4c3c0a5e037618bef1ae944485e3f7840b /core
parentb536c348359487f0408a17af8d9d506f5a1d18a6 (diff)
downloadchrome-ec-32b7e8875e0a08290168ec7dda040d5a5db513fa.tar.gz
core: rename atomic_clear to atomic_clear_bits
Change the name of atomic_clear to atomic_clear_bits to make to name more clear - the function clears only selected bits, but the name may suggest that it clears the whole variable. It is done as a part of porting to Zephyr, where atomic_clear zeros the variable. BUG=b:169151160 BRANCH=none TEST=buildall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I7b0b47959c6c54af40f61bca8d9baebaa0375970 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2428943 Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/cortex-m/atomic.h4
-rw-r--r--core/cortex-m/task.c14
-rw-r--r--core/cortex-m0/atomic.h4
-rw-r--r--core/cortex-m0/task.c8
-rw-r--r--core/host/atomic.h4
-rw-r--r--core/minute-ia/atomic.h4
-rw-r--r--core/minute-ia/task.c8
-rw-r--r--core/nds32/atomic.h4
-rw-r--r--core/nds32/task.c6
-rw-r--r--core/riscv-rv32i/atomic.h4
-rw-r--r--core/riscv-rv32i/task.c8
11 files changed, 34 insertions, 34 deletions
diff --git a/core/cortex-m/atomic.h b/core/cortex-m/atomic.h
index 4d56ce3e4e..736d5887b4 100644
--- a/core/cortex-m/atomic.h
+++ b/core/cortex-m/atomic.h
@@ -36,8 +36,8 @@
* removed in the following patches. Please see b:169151160 for more details.
*/
-static inline void deprecated_atomic_clear(uint32_t volatile *addr,
- uint32_t bits)
+static inline void deprecated_atomic_clear_bits(uint32_t volatile *addr,
+ uint32_t bits)
{
ATOMIC_OP(bic, addr, bits);
}
diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c
index 058b892a46..510d18fca0 100644
--- a/core/cortex-m/task.c
+++ b/core/cortex-m/task.c
@@ -421,7 +421,7 @@ static uint32_t __wait_evt(int timeout_us, task_id_t resched)
if (timeout_us > 0) {
timer_cancel(me);
/* Ensure timer event is clear, we no longer care about it */
- deprecated_atomic_clear(&tsk->events, TASK_EVENT_TIMER);
+ deprecated_atomic_clear_bits(&tsk->events, TASK_EVENT_TIMER);
}
return evt;
}
@@ -501,7 +501,7 @@ void task_enable_task(task_id_t tskid)
void task_disable_task(task_id_t tskid)
{
- deprecated_atomic_clear(&tasks_enabled, BIT(tskid));
+ deprecated_atomic_clear_bits(&tasks_enabled, BIT(tskid));
if (!in_interrupt_context() && tskid == task_get_current())
__schedule(0, 0);
@@ -579,8 +579,8 @@ static void deferred_task_reset(void)
while (deferred_reset_task_ids) {
task_id_t reset_id = __fls(deferred_reset_task_ids);
- deprecated_atomic_clear(&deferred_reset_task_ids,
- 1 << reset_id);
+ deprecated_atomic_clear_bits(&deferred_reset_task_ids,
+ 1 << reset_id);
do_task_reset(reset_id);
}
}
@@ -760,7 +760,7 @@ int task_reset_cleanup(void)
* itself back to the list of tasks to notify,
* and we will notify it again.
*/
- deprecated_atomic_clear(state, 1 << notify_id);
+ deprecated_atomic_clear_bits(state, 1 << notify_id);
/*
* Skip any invalid ids set by tasks that
* requested a non-blocking reset.
@@ -897,7 +897,7 @@ void mutex_lock(struct mutex *mtx)
task_wait_event_mask(TASK_EVENT_MUTEX, 0);
} while (value);
- deprecated_atomic_clear(&mtx->waiters, id);
+ deprecated_atomic_clear_bits(&mtx->waiters, id);
}
void mutex_unlock(struct mutex *mtx)
@@ -923,7 +923,7 @@ void mutex_unlock(struct mutex *mtx)
}
/* Ensure no event is remaining from mutex wake-up */
- deprecated_atomic_clear(&tsk->events, TASK_EVENT_MUTEX);
+ deprecated_atomic_clear_bits(&tsk->events, TASK_EVENT_MUTEX);
}
void task_print_list(void)
diff --git a/core/cortex-m0/atomic.h b/core/cortex-m0/atomic.h
index 414e6a56c1..78ac91a676 100644
--- a/core/cortex-m0/atomic.h
+++ b/core/cortex-m0/atomic.h
@@ -33,8 +33,8 @@
* removed in the following patches. Please see b:169151160 for more details.
*/
-static inline void deprecated_atomic_clear(uint32_t volatile *addr,
- uint32_t bits)
+static inline void deprecated_atomic_clear_bits(uint32_t volatile *addr,
+ uint32_t bits)
{
ATOMIC_OP(bic, addr, bits);
}
diff --git a/core/cortex-m0/task.c b/core/cortex-m0/task.c
index 657ed88a73..3e54630ab2 100644
--- a/core/cortex-m0/task.c
+++ b/core/cortex-m0/task.c
@@ -349,7 +349,7 @@ static uint32_t __wait_evt(int timeout_us, task_id_t resched)
if (timeout_us > 0) {
timer_cancel(me);
/* Ensure timer event is clear, we no longer care about it */
- deprecated_atomic_clear(&tsk->events, TASK_EVENT_TIMER);
+ deprecated_atomic_clear_bits(&tsk->events, TASK_EVENT_TIMER);
}
return evt;
}
@@ -441,7 +441,7 @@ void task_enable_task(task_id_t tskid)
void task_disable_task(task_id_t tskid)
{
- deprecated_atomic_clear(&tasks_enabled, BIT(tskid));
+ deprecated_atomic_clear_bits(&tasks_enabled, BIT(tskid));
if (!in_interrupt_context() && tskid == task_get_current())
__schedule(0, 0);
@@ -514,7 +514,7 @@ void mutex_lock(struct mutex *mtx)
mtx->lock = 2;
__asm__ __volatile__("cpsie i");
- deprecated_atomic_clear(&mtx->waiters, id);
+ deprecated_atomic_clear_bits(&mtx->waiters, id);
}
void mutex_unlock(struct mutex *mtx)
@@ -540,7 +540,7 @@ void mutex_unlock(struct mutex *mtx)
}
/* Ensure no event is remaining from mutex wake-up */
- deprecated_atomic_clear(&tsk->events, TASK_EVENT_MUTEX);
+ deprecated_atomic_clear_bits(&tsk->events, TASK_EVENT_MUTEX);
}
void task_print_list(void)
diff --git a/core/host/atomic.h b/core/host/atomic.h
index 4150a20216..7f2e0ba16f 100644
--- a/core/host/atomic.h
+++ b/core/host/atomic.h
@@ -16,8 +16,8 @@
* removed in the following patches. Please see b:169151160 for more details.
*/
-static inline void deprecated_atomic_clear(uint32_t volatile *addr,
- uint32_t bits)
+static inline void deprecated_atomic_clear_bits(uint32_t volatile *addr,
+ uint32_t bits)
{
__sync_and_and_fetch(addr, ~bits);
}
diff --git a/core/minute-ia/atomic.h b/core/minute-ia/atomic.h
index 89ed35340c..598fc5b3ed 100644
--- a/core/minute-ia/atomic.h
+++ b/core/minute-ia/atomic.h
@@ -48,8 +48,8 @@ static inline void deprecated_atomic_and_u8(uint8_t *addr, uint8_t bits)
ATOMIC_OP(and, addr, bits);
}
-static inline void deprecated_atomic_clear(uint32_t volatile *addr,
- uint32_t bits)
+static inline void deprecated_atomic_clear_bits(uint32_t volatile *addr,
+ uint32_t bits)
{
ATOMIC_OP(andl, addr, ~bits);
}
diff --git a/core/minute-ia/task.c b/core/minute-ia/task.c
index f0296596b1..431bd62e54 100644
--- a/core/minute-ia/task.c
+++ b/core/minute-ia/task.c
@@ -326,7 +326,7 @@ static uint32_t __wait_evt(int timeout_us, task_id_t resched)
if (timeout_us > 0) {
timer_cancel(me);
/* Ensure timer event is clear, we no longer care about it */
- deprecated_atomic_clear(&tsk->events, TASK_EVENT_TIMER);
+ deprecated_atomic_clear_bits(&tsk->events, TASK_EVENT_TIMER);
}
return evt;
}
@@ -411,7 +411,7 @@ void task_enable_task(task_id_t tskid)
void task_disable_task(task_id_t tskid)
{
- deprecated_atomic_clear(&tasks_enabled, BIT(tskid));
+ deprecated_atomic_clear_bits(&tasks_enabled, BIT(tskid));
if (!in_interrupt_context() && tskid == task_get_current())
__schedule(0, 0);
@@ -471,7 +471,7 @@ void mutex_lock(struct mutex *mtx)
}
} while (old_val);
- deprecated_atomic_clear(&mtx->waiters, id);
+ deprecated_atomic_clear_bits(&mtx->waiters, id);
}
void mutex_unlock(struct mutex *mtx)
@@ -498,7 +498,7 @@ void mutex_unlock(struct mutex *mtx)
}
/* Ensure no event is remaining from mutex wake-up */
- deprecated_atomic_clear(&tsk->events, TASK_EVENT_MUTEX);
+ deprecated_atomic_clear_bits(&tsk->events, TASK_EVENT_MUTEX);
}
void task_print_list(void)
diff --git a/core/nds32/atomic.h b/core/nds32/atomic.h
index e10a35aa54..d93d1e7b06 100644
--- a/core/nds32/atomic.h
+++ b/core/nds32/atomic.h
@@ -18,8 +18,8 @@
* removed in the following patches. Please see b:169151160 for more details.
*/
-static inline void deprecated_atomic_clear(uint32_t volatile *addr,
- uint32_t bits)
+static inline void deprecated_atomic_clear_bits(uint32_t volatile *addr,
+ uint32_t bits)
{
uint32_t int_mask = read_clear_int_mask();
diff --git a/core/nds32/task.c b/core/nds32/task.c
index c6ae32912e..9c3d6357ac 100644
--- a/core/nds32/task.c
+++ b/core/nds32/task.c
@@ -411,7 +411,7 @@ static uint32_t __ram_code __wait_evt(int timeout_us, task_id_t resched)
if (timeout_us > 0) {
timer_cancel(me);
/* Ensure timer event is clear, we no longer care about it */
- deprecated_atomic_clear(&tsk->events, TASK_EVENT_TIMER);
+ deprecated_atomic_clear_bits(&tsk->events, TASK_EVENT_TIMER);
}
return evt;
}
@@ -526,7 +526,7 @@ void task_enable_task(task_id_t tskid)
void task_disable_task(task_id_t tskid)
{
- deprecated_atomic_clear(&tasks_enabled, BIT(tskid));
+ deprecated_atomic_clear_bits(&tasks_enabled, BIT(tskid));
if (!in_interrupt_context() && tskid == task_get_current())
__schedule(0, 0, 0);
@@ -644,7 +644,7 @@ void __ram_code mutex_unlock(struct mutex *mtx)
}
/* Ensure no event is remaining from mutex wake-up */
- deprecated_atomic_clear(&tsk->events, TASK_EVENT_MUTEX);
+ deprecated_atomic_clear_bits(&tsk->events, TASK_EVENT_MUTEX);
}
void task_print_list(void)
diff --git a/core/riscv-rv32i/atomic.h b/core/riscv-rv32i/atomic.h
index a9e4df0344..db21e2a70d 100644
--- a/core/riscv-rv32i/atomic.h
+++ b/core/riscv-rv32i/atomic.h
@@ -28,8 +28,8 @@
* removed in the following patches. Please see b:169151160 for more details.
*/
-static inline void deprecated_atomic_clear(volatile uint32_t *addr,
- uint32_t bits)
+static inline void deprecated_atomic_clear_bits(volatile uint32_t *addr,
+ uint32_t bits)
{
ATOMIC_OP(and, ~bits, addr);
}
diff --git a/core/riscv-rv32i/task.c b/core/riscv-rv32i/task.c
index 862f9e3b81..ecd8d72382 100644
--- a/core/riscv-rv32i/task.c
+++ b/core/riscv-rv32i/task.c
@@ -405,7 +405,7 @@ static uint32_t __ram_code __wait_evt(int timeout_us, task_id_t resched)
if (timeout_us > 0) {
timer_cancel(me);
/* Ensure timer event is clear, we no longer care about it */
- deprecated_atomic_clear(&tsk->events, TASK_EVENT_TIMER);
+ deprecated_atomic_clear_bits(&tsk->events, TASK_EVENT_TIMER);
}
return evt;
}
@@ -499,7 +499,7 @@ void task_enable_task(task_id_t tskid)
void task_disable_task(task_id_t tskid)
{
- deprecated_atomic_clear(&tasks_enabled, BIT(tskid));
+ deprecated_atomic_clear_bits(&tasks_enabled, BIT(tskid));
if (!in_interrupt_context() && tskid == task_get_current())
__schedule(0, 0, 0);
@@ -575,7 +575,7 @@ void __ram_code mutex_lock(struct mutex *mtx)
task_wait_event_mask(TASK_EVENT_MUTEX, 0);
}
- deprecated_atomic_clear(&mtx->waiters, id);
+ deprecated_atomic_clear_bits(&mtx->waiters, id);
}
void __ram_code mutex_unlock(struct mutex *mtx)
@@ -599,7 +599,7 @@ void __ram_code mutex_unlock(struct mutex *mtx)
}
/* Ensure no event is remaining from mutex wake-up */
- deprecated_atomic_clear(&tsk->events, TASK_EVENT_MUTEX);
+ deprecated_atomic_clear_bits(&tsk->events, TASK_EVENT_MUTEX);
}
void task_print_list(void)