Ignore:
File:
1 edited

Legend:

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

    r7a0359b rd99c1d2  
    3939#include <arch/barrier.h>
    4040#include <preemption.h>
    41 #include <trace.h>
    4241
    43 NO_TRACE static inline void atomic_inc(atomic_t *val)
     42static inline void atomic_inc(atomic_t *val)
    4443{
    4544#ifdef CONFIG_SMP
     
    5655}
    5756
    58 NO_TRACE static inline void atomic_dec(atomic_t *val)
     57static inline void atomic_dec(atomic_t *val)
    5958{
    6059#ifdef CONFIG_SMP
     
    7170}
    7271
    73 NO_TRACE static inline atomic_count_t atomic_postinc(atomic_t *val)
     72static inline atomic_count_t atomic_postinc(atomic_t *val)
    7473{
    7574        atomic_count_t r = 1;
     
    8483}
    8584
    86 NO_TRACE static inline atomic_count_t atomic_postdec(atomic_t *val)
     85static inline atomic_count_t atomic_postdec(atomic_t *val)
    8786{
    8887        atomic_count_t r = -1;
     
    10099#define atomic_predec(val)  (atomic_postdec(val) - 1)
    101100
    102 NO_TRACE static inline atomic_count_t test_and_set(atomic_t *val)
     101static inline atomic_count_t test_and_set(atomic_t *val)
    103102{
    104103        atomic_count_t v = 1;
     
    114113
    115114/** amd64 specific fast spinlock */
    116 NO_TRACE static inline void atomic_lock_arch(atomic_t *val)
     115static inline void atomic_lock_arch(atomic_t *val)
    117116{
    118117        atomic_count_t tmp;
     
    121120        asm volatile (
    122121                "0:\n"
    123                 "       pause\n"
    124                 "       mov %[count], %[tmp]\n"
    125                 "       testq %[tmp], %[tmp]\n"
    126                 "       jnz 0b\n"       /* lightweight looping on locked spinlock */
     122                "pause\n"
     123                "mov %[count], %[tmp]\n"
     124                "testq %[tmp], %[tmp]\n"
     125                "jnz 0b\n"       /* lightweight looping on locked spinlock */
    127126               
    128                 "       incq %[tmp]\n"  /* now use the atomic operation */
    129                 "       xchgq %[count], %[tmp]\n"
    130                 "       testq %[tmp], %[tmp]\n"
    131                 "       jnz 0b\n"
     127                "incq %[tmp]\n"  /* now use the atomic operation */
     128                "xchgq %[count], %[tmp]\n"
     129                "testq %[tmp], %[tmp]\n"
     130                "jnz 0b\n"
    132131                : [count] "+m" (val->count),
    133132                  [tmp] "=&r" (tmp)
Note: See TracChangeset for help on using the changeset viewer.