Changeset 9ce35f0 in mainline


Ignore:
Timestamp:
2018-03-26T15:21:43Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fd57745c
Parents:
48974d6
Message:

Add two missing intrinsics for arm32.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/src/atomic.c

    r48974d6 r9ce35f0  
    6666}
    6767
     68/* Naive implementations of the newer intrinsics. */
     69
     70_Bool __atomic_compare_exchange_4(void **mem, void **expected, void *desired, _Bool weak, int success, int failure)
     71{
     72        (void) weak;
     73        (void) success;
     74        (void) failure;
     75
     76        void *old = *expected;
     77        void *new = __sync_val_compare_and_swap_4(mem, old, desired);
     78        if (old == new) {
     79                return 1;
     80        } else {
     81                *expected = new;
     82                return 0;
     83        }
     84}
     85
     86void *__atomic_exchange_4(void **mem, void *val, int model)
     87{
     88        (void) model;
     89
     90        irq_spinlock_lock(&cas_lock, true);
     91        void *old = *mem;
     92        *mem = val;
     93        irq_spinlock_unlock(&cas_lock, true);
     94
     95        return old;
     96}
    6897
    6998/** @}
Note: See TracChangeset for help on using the changeset viewer.