Changeset fc10e1b in mainline for kernel/generic/src/mm/as.c


Ignore:
Timestamp:
2018-09-07T16:34:11Z (7 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/mm/as.c

    r508b0df1 rfc10e1b  
    163163                as->asid = ASID_INVALID;
    164164
    165         atomic_set(&as->refcount, 0);
     165        refcount_init(&as->refcount);
    166166        as->cpu_refcount = 0;
    167167
     
    190190
    191191        assert(as != AS);
    192         assert(atomic_get(&as->refcount) == 0);
     192        assert(refcount_unique(&as->refcount));
    193193
    194194        /*
     
    267267NO_TRACE void as_hold(as_t *as)
    268268{
    269         atomic_inc(&as->refcount);
     269        refcount_up(&as->refcount);
    270270}
    271271
     
    275275 * destroys the address space.
    276276 *
    277  * @param asAddress space to be released.
     277 * @param as Address space to be released.
    278278 *
    279279 */
    280280NO_TRACE void as_release(as_t *as)
    281281{
    282         if (atomic_predec(&as->refcount) == 0)
     282        if (refcount_down(&as->refcount))
    283283                as_destroy(as);
    284284}
Note: See TracChangeset for help on using the changeset viewer.