summaryrefslogtreecommitdiff
path: root/core/cortex-m0/task.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/cortex-m0/task.c')
-rw-r--r--core/cortex-m0/task.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/core/cortex-m0/task.c b/core/cortex-m0/task.c
index 3e54630ab2..d8ed4a6376 100644
--- a/core/cortex-m0/task.c
+++ b/core/cortex-m0/task.c
@@ -334,7 +334,7 @@ static uint32_t __wait_evt(int timeout_us, task_id_t resched)
ret = timer_arm(deadline, me);
ASSERT(ret == EC_SUCCESS);
}
- while (!(evt = deprecated_atomic_read_clear(&tsk->events))) {
+ while (!(evt = atomic_read_clear(&tsk->events))) {
/*
* We need to ensure that the execution priority is actually
* decreased after the "cpsie i" in the atomic operation above
@@ -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_bits(&tsk->events, TASK_EVENT_TIMER);
+ atomic_clear_bits(&tsk->events, TASK_EVENT_TIMER);
}
return evt;
}
@@ -360,12 +360,12 @@ uint32_t task_set_event(task_id_t tskid, uint32_t event, int wait)
ASSERT(receiver);
/* Set the event bit in the receiver message bitmap */
- deprecated_atomic_or(&receiver->events, event);
+ atomic_or(&receiver->events, event);
/* Re-schedule if priorities have changed */
if (in_interrupt_context()) {
/* The receiver might run again */
- deprecated_atomic_or(&tasks_ready, 1 << tskid);
+ atomic_or(&tasks_ready, 1 << tskid);
if (start_called) {
/*
* Trigger the scheduler when there's
@@ -420,8 +420,7 @@ uint32_t task_wait_event_mask(uint32_t event_mask, int timeout_us)
/* Re-post any other events collected */
if (events & ~event_mask)
- deprecated_atomic_or(&current_task->events,
- events & ~event_mask);
+ atomic_or(&current_task->events, events & ~event_mask);
return events & event_mask;
}
@@ -436,12 +435,12 @@ void task_enable_all_tasks(void)
void task_enable_task(task_id_t tskid)
{
- deprecated_atomic_or(&tasks_enabled, BIT(tskid));
+ atomic_or(&tasks_enabled, BIT(tskid));
}
void task_disable_task(task_id_t tskid)
{
- deprecated_atomic_clear_bits(&tasks_enabled, BIT(tskid));
+ atomic_clear_bits(&tasks_enabled, BIT(tskid));
if (!in_interrupt_context() && tskid == task_get_current())
__schedule(0, 0);
@@ -500,7 +499,7 @@ void mutex_lock(struct mutex *mtx)
uint32_t id = 1 << task_get_current();
ASSERT(id != TASK_ID_INVALID);
- deprecated_atomic_or(&mtx->waiters, id);
+ atomic_or(&mtx->waiters, id);
while (1) {
/* Try to get the lock (set 2 into the lock field) */
@@ -514,7 +513,7 @@ void mutex_lock(struct mutex *mtx)
mtx->lock = 2;
__asm__ __volatile__("cpsie i");
- deprecated_atomic_clear_bits(&mtx->waiters, id);
+ atomic_clear_bits(&mtx->waiters, id);
}
void mutex_unlock(struct mutex *mtx)
@@ -540,7 +539,7 @@ void mutex_unlock(struct mutex *mtx)
}
/* Ensure no event is remaining from mutex wake-up */
- deprecated_atomic_clear_bits(&tsk->events, TASK_EVENT_MUTEX);
+ atomic_clear_bits(&tsk->events, TASK_EVENT_MUTEX);
}
void task_print_list(void)