Ignore:
Timestamp:
2006-09-14T17:09:21Z (19 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
  • uspace/libc/arch/sparc64/include/atomic.h

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