Ignore:
File:
1 edited

Legend:

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

    r9ce35f0 ra35b458  
    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 
    86 void *__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 }
    9768
    9869/** @}
Note: See TracChangeset for help on using the changeset viewer.