Changeset 06e1e95 in mainline for kernel/arch/sparc64/include/atomic.h


Ignore:
Timestamp:
2006-09-14T17:09:21Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f1d1f5d3
Parents:
e5ecc02
Message:

C99 compliant header guards (hopefully) everywhere in the kernel.
Formatting and indentation changes.
Small improvements in sparc64.

File:
1 edited

Legend:

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

    re5ecc02 r06e1e95  
    5151{
    5252        uint64_t a, b;
    53         volatile uint64_t x = (uint64_t) &val->count;
    5453
    55         __asm__ volatile (
    56                 "0:\n"
    57                 "ldx %0, %1\n"
    58                 "add %1, %3, %2\n"
    59                 "casx %0, %1, %2\n"
    60                 "cmp %1, %2\n"
    61                 "bne 0b\n"              /* The operation failed and must be attempted again if a != b. */
    62                 "nop\n"
    63                 : "=m" (*((uint64_t *)x)), "=r" (a), "=r" (b)
    64                 : "r" (i)
    65         );
     54        do {
     55                volatile uintptr_t x = (uint64_t) &val->count;
     56
     57                a = *((uint64_t *) x);
     58                b = a + i;
     59                __asm__ volatile ("casx %0, %1, %2\n": "+m" (*((uint64_t *)x)), "+r" (a), "+r" (b));
     60        } while (a != b);
    6661
    6762        return a;
Note: See TracChangeset for help on using the changeset viewer.