Changeset 7038f55 in mainline for kernel/arch/ia64/include/atomic.h


Ignore:
Timestamp:
2009-07-24T16:04:52Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6ac14a70
Parents:
1641eb0
Message:

Add simple atomic_lock_arch() for ia64

File:
1 edited

Legend:

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

    r1641eb0 r7038f55  
    5353}
    5454
    55 
    56 static inline uint64_t test_and_set(atomic_t *val) {
     55static inline uint64_t test_and_set(atomic_t *val)
     56{
    5757        uint64_t v;
    5858               
    5959        asm volatile (
    60                 "movl %0 = 0x01;;\n"
     60                "movl %0 = 0x1;;\n"
    6161                "xchg8 %0 = %1, %0;;\n"
    6262                : "=r" (v), "+m" (val->count)
     
    6666}
    6767
     68static inline void atomic_lock_arch(atomic_t *val)
     69{
     70        do {
     71                while (val->count)
     72                        ;
     73        } while (test_and_set(val));
     74}
    6875
    6976static inline void atomic_inc(atomic_t *val)
Note: See TracChangeset for help on using the changeset viewer.