Changeset bd48f4c in mainline for kernel/arch/amd64/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/amd64/include/atomic.h

    rc40e6ef rbd48f4c  
    3939#include <arch/barrier.h>
    4040#include <preemption.h>
     41#include <trace.h>
    4142
    42 static inline void atomic_inc(atomic_t *val)
     43NO_TRACE static inline void atomic_inc(atomic_t *val)
    4344{
    4445#ifdef CONFIG_SMP
     
    5556}
    5657
    57 static inline void atomic_dec(atomic_t *val)
     58NO_TRACE static inline void atomic_dec(atomic_t *val)
    5859{
    5960#ifdef CONFIG_SMP
     
    7071}
    7172
    72 static inline atomic_count_t atomic_postinc(atomic_t *val)
     73NO_TRACE static inline atomic_count_t atomic_postinc(atomic_t *val)
    7374{
    7475        atomic_count_t r = 1;
     
    8384}
    8485
    85 static inline atomic_count_t atomic_postdec(atomic_t *val)
     86NO_TRACE static inline atomic_count_t atomic_postdec(atomic_t *val)
    8687{
    8788        atomic_count_t r = -1;
     
    99100#define atomic_predec(val)  (atomic_postdec(val) - 1)
    100101
    101 static inline atomic_count_t test_and_set(atomic_t *val)
     102NO_TRACE static inline atomic_count_t test_and_set(atomic_t *val)
    102103{
    103104        atomic_count_t v = 1;
     
    113114
    114115/** amd64 specific fast spinlock */
    115 static inline void atomic_lock_arch(atomic_t *val)
     116NO_TRACE static inline void atomic_lock_arch(atomic_t *val)
    116117{
    117118        atomic_count_t tmp;
     
    120121        asm volatile (
    121122                "0:\n"
    122                 "pause\n"
    123                 "mov %[count], %[tmp]\n"
    124                 "testq %[tmp], %[tmp]\n"
    125                 "jnz 0b\n"       /* lightweight looping on locked spinlock */
     123                "       pause\n"
     124                "       mov %[count], %[tmp]\n"
     125                "       testq %[tmp], %[tmp]\n"
     126                "       jnz 0b\n"       /* lightweight looping on locked spinlock */
    126127               
    127                 "incq %[tmp]\n"  /* now use the atomic operation */
    128                 "xchgq %[count], %[tmp]\n"
    129                 "testq %[tmp], %[tmp]\n"
    130                 "jnz 0b\n"
     128                "       incq %[tmp]\n"  /* now use the atomic operation */
     129                "       xchgq %[count], %[tmp]\n"
     130                "       testq %[tmp], %[tmp]\n"
     131                "       jnz 0b\n"
    131132                : [count] "+m" (val->count),
    132133                  [tmp] "=&r" (tmp)
Note: See TracChangeset for help on using the changeset viewer.