Changeset fc10e1b in mainline for kernel/generic/src/ipc/ipc.c


Ignore:
Timestamp:
2018-09-07T16:34:11Z (6 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d2c91ab
Parents:
508b0df1 (diff), e90cfa6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'atomic'

Use more of <stdatomic.h> in kernel. Increment/decrement macros kept because
the are handy. atomic_t currently kept because I'm way too lazy to go through
all uses and think about the most appropriate replacement.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/ipc.c

    r508b0df1 rfc10e1b  
    154154        list_initialize(&box->answers);
    155155        list_initialize(&box->irq_notifs);
    156         atomic_set(&box->active_calls, 0);
     156        atomic_store(&box->active_calls, 0);
    157157        box->task = task;
    158158}
     
    204204        phone->callee = NULL;
    205205        phone->state = IPC_PHONE_FREE;
    206         atomic_set(&phone->active_calls, 0);
     206        atomic_store(&phone->active_calls, 0);
    207207        phone->kobject = NULL;
    208208}
     
    783783static void ipc_wait_for_all_answered_calls(void)
    784784{
    785         while (atomic_get(&TASK->answerbox.active_calls) != 0) {
     785        while (atomic_load(&TASK->answerbox.active_calls) != 0) {
    786786                call_t *call = NULL;
    787787                if (ipc_wait_for_call(&TASK->answerbox,
     
    873873        ipc_wait_for_all_answered_calls();
    874874
    875         assert(atomic_get(&TASK->answerbox.active_calls) == 0);
     875        assert(atomic_load(&TASK->answerbox.active_calls) == 0);
    876876}
    877877
     
    928928        if (phone->state != IPC_PHONE_FREE) {
    929929                printf("%-11d %7" PRIun " ", (int) CAP_HANDLE_RAW(cap->handle),
    930                     atomic_get(&phone->active_calls));
     930                    atomic_load(&phone->active_calls));
    931931
    932932                switch (phone->state) {
     
    981981
    982982        printf("Active calls: %" PRIun "\n",
    983             atomic_get(&task->answerbox.active_calls));
     983            atomic_load(&task->answerbox.active_calls));
    984984
    985985#ifdef __32_BITS__
Note: See TracChangeset for help on using the changeset viewer.