Changeset 58775d30 in mainline for kernel/arch/sparc32/src/sparc32.c


Ignore:
Timestamp:
2015-03-16T16:07:21Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2003739
Parents:
6069061 (diff), 795e2bf (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:

Mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc32/src/sparc32.c

    r6069061 r58775d30  
    3737#include <arch/interrupt.h>
    3838#include <arch/asm.h>
     39#include <arch/barrier.h>
    3940#include <arch/machine_func.h>
    4041#include <func.h>
     
    169170}
    170171
     172bool __atomic_compare_exchange_4(uint32_t *ptr, uint32_t *expected,
     173    uint32_t desired, bool weak, int success_mm, int failure_mm)
     174{
     175        ipl_t ipl;
     176        bool success;
     177
     178        /* XXX: This is a rather dummy implementation. */
     179
     180        ipl = interrupts_disable();
     181        memory_barrier();
     182        if (*ptr == *expected) {
     183                success = true;
     184                *ptr = desired;
     185        } else {
     186                success = false;
     187                *expected = *ptr;
     188        }
     189        memory_barrier();
     190        interrupts_restore(ipl);
     191
     192        return success;
     193}
     194
    171195/** @}
    172196 */
Note: See TracChangeset for help on using the changeset viewer.