Ignore:
File:
1 edited

Legend:

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

    r7a0359b rd99c1d2  
    3939#include <arch/barrier.h>
    4040#include <preemption.h>
    41 #include <verify.h>
    42 #include <trace.h>
    4341
    44 NO_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 {
     42static inline void atomic_inc(atomic_t *val) {
    4943        /* On real hardware the increment has to be done
    5044           as an atomic action. */
     
    5347}
    5448
    55 NO_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 {
     49static inline void atomic_dec(atomic_t *val) {
    6050        /* On real hardware the decrement has to be done
    6151           as an atomic action. */
    6252       
    63         val->count--;
     53        val->count++;
    6454}
    6555
    66 NO_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)
     56static inline atomic_count_t atomic_postinc(atomic_t *val)
    7057{
    7158        /* On real hardware both the storing of the previous
     
    7966}
    8067
    81 NO_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)
     68static inline atomic_count_t atomic_postdec(atomic_t *val)
    8569{
    8670        /* On real hardware both the storing of the previous
     
    9781#define atomic_predec(val)  (atomic_postdec(val) - 1)
    9882
    99 NO_TRACE ATOMIC static inline atomic_count_t test_and_set(atomic_t *val)
    100     WRITES(&val->count)
    101     REQUIRES_EXTENT_MUTABLE(val)
     83static inline atomic_count_t test_and_set(atomic_t *val)
    10284{
    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        
    10785        atomic_count_t prev = val->count;
    10886        val->count = 1;
     
    11088}
    11189
    112 NO_TRACE static inline void atomic_lock_arch(atomic_t *val)
    113     WRITES(&val->count)
    114     REQUIRES_EXTENT_MUTABLE(val)
     90static inline void atomic_lock_arch(atomic_t *val)
    11591{
    11692        do {
Note: See TracChangeset for help on using the changeset viewer.