Ignore:
File:
1 edited

Legend:

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

    r33c4f72 rd99c1d2  
    3939#include <arch/barrier.h>
    4040#include <preemption.h>
    41 #include <verify.h>
    4241
    43 ATOMIC static inline void atomic_inc(atomic_t *val)
    44     WRITES(&val->count)
    45     REQUIRES_EXTENT_MUTABLE(val)
    46     REQUIRES(val->count < ATOMIC_COUNT_MAX)
    47 {
     42static inline void atomic_inc(atomic_t *val) {
    4843        /* On real hardware the increment has to be done
    4944           as an atomic action. */
     
    5247}
    5348
    54 ATOMIC static inline void atomic_dec(atomic_t *val)
    55     WRITES(&val->count)
    56     REQUIRES_EXTENT_MUTABLE(val)
    57     REQUIRES(val->count > ATOMIC_COUNT_MIN)
    58 {
     49static inline void atomic_dec(atomic_t *val) {
    5950        /* On real hardware the decrement has to be done
    6051           as an atomic action. */
    6152       
    62         val->count--;
     53        val->count++;
    6354}
    6455
    65 ATOMIC static inline atomic_count_t atomic_postinc(atomic_t *val)
    66     WRITES(&val->count)
    67     REQUIRES_EXTENT_MUTABLE(val)
    68     REQUIRES(val->count < ATOMIC_COUNT_MAX)
     56static inline atomic_count_t atomic_postinc(atomic_t *val)
    6957{
    7058        /* On real hardware both the storing of the previous
     
    7866}
    7967
    80 ATOMIC static inline atomic_count_t atomic_postdec(atomic_t *val)
    81     WRITES(&val->count)
    82     REQUIRES_EXTENT_MUTABLE(val)
    83     REQUIRES(val->count > ATOMIC_COUNT_MIN)
     68static inline atomic_count_t atomic_postdec(atomic_t *val)
    8469{
    8570        /* On real hardware both the storing of the previous
     
    9681#define atomic_predec(val)  (atomic_postdec(val) - 1)
    9782
    98 ATOMIC static inline atomic_count_t test_and_set(atomic_t *val)
    99     WRITES(&val->count)
    100     REQUIRES_EXTENT_MUTABLE(val)
     83static inline atomic_count_t test_and_set(atomic_t *val)
    10184{
    102         /* On real hardware the retrieving of the original
    103            value and storing 1 have to be done as a single
    104            atomic action. */
    105        
    10685        atomic_count_t prev = val->count;
    10786        val->count = 1;
     
    11089
    11190static inline void atomic_lock_arch(atomic_t *val)
    112     WRITES(&val->count)
    113     REQUIRES_EXTENT_MUTABLE(val)
    11491{
    11592        do {
Note: See TracChangeset for help on using the changeset viewer.