Changeset bd48f4c in mainline for kernel/arch/abs32le/include/atomic.h


Ignore:
Timestamp:
2010-07-12T10:53:30Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bd11d3e
Parents:
c40e6ef (diff), bee2d4c (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 mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/abs32le/include/atomic.h

    rc40e6ef rbd48f4c  
    3939#include <arch/barrier.h>
    4040#include <preemption.h>
     41#include <verify.h>
     42#include <trace.h>
    4143
    42 static inline void atomic_inc(atomic_t *val) {
     44NO_TRACE ATOMIC static inline void atomic_inc(atomic_t *val)
     45    WRITES(&val->count)
     46    REQUIRES_EXTENT_MUTABLE(val)
     47    REQUIRES(val->count < ATOMIC_COUNT_MAX)
     48{
    4349        /* On real hardware the increment has to be done
    4450           as an atomic action. */
     
    4753}
    4854
    49 static inline void atomic_dec(atomic_t *val) {
     55NO_TRACE ATOMIC static inline void atomic_dec(atomic_t *val)
     56    WRITES(&val->count)
     57    REQUIRES_EXTENT_MUTABLE(val)
     58    REQUIRES(val->count > ATOMIC_COUNT_MIN)
     59{
    5060        /* On real hardware the decrement has to be done
    5161           as an atomic action. */
    5262       
    53         val->count++;
     63        val->count--;
    5464}
    5565
    56 static inline atomic_count_t atomic_postinc(atomic_t *val)
     66NO_TRACE ATOMIC static inline atomic_count_t atomic_postinc(atomic_t *val)
     67    WRITES(&val->count)
     68    REQUIRES_EXTENT_MUTABLE(val)
     69    REQUIRES(val->count < ATOMIC_COUNT_MAX)
    5770{
    5871        /* On real hardware both the storing of the previous
     
    6679}
    6780
    68 static inline atomic_count_t atomic_postdec(atomic_t *val)
     81NO_TRACE ATOMIC static inline atomic_count_t atomic_postdec(atomic_t *val)
     82    WRITES(&val->count)
     83    REQUIRES_EXTENT_MUTABLE(val)
     84    REQUIRES(val->count > ATOMIC_COUNT_MIN)
    6985{
    7086        /* On real hardware both the storing of the previous
     
    8197#define atomic_predec(val)  (atomic_postdec(val) - 1)
    8298
    83 static inline atomic_count_t test_and_set(atomic_t *val)
     99NO_TRACE ATOMIC static inline atomic_count_t test_and_set(atomic_t *val)
     100    WRITES(&val->count)
     101    REQUIRES_EXTENT_MUTABLE(val)
    84102{
     103        /* On real hardware the retrieving of the original
     104           value and storing 1 have to be done as a single
     105           atomic action. */
     106       
    85107        atomic_count_t prev = val->count;
    86108        val->count = 1;
     
    88110}
    89111
    90 static inline void atomic_lock_arch(atomic_t *val)
     112NO_TRACE static inline void atomic_lock_arch(atomic_t *val)
     113    WRITES(&val->count)
     114    REQUIRES_EXTENT_MUTABLE(val)
    91115{
    92116        do {
Note: See TracChangeset for help on using the changeset viewer.