Ignore:
Timestamp:
2010-03-07T15:11:56Z (15 years ago)
Author:
Lukas Mejdrech <lukasmejdrech@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
aadf01e
Parents:
2e99277 (diff), 137691a (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, revision 308

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/arch/ppc32/include/atomic.h

    r2e99277 raa85487  
    2727 */
    2828
    29 /** @addtogroup libcppc32       
     29/** @addtogroup libcppc32
    3030 * @{
    3131 */
     
    4242static inline void atomic_inc(atomic_t *val)
    4343{
    44         long tmp;
    45 
     44        atomic_count_t tmp;
     45       
    4646        asm volatile (
    4747                "1:\n"
     
    5050                "stwcx. %0, 0, %2\n"
    5151                "bne- 1b"
    52                 : "=&r" (tmp), "=m" (val->count)
    53                 : "r" (&val->count), "m" (val->count)
    54                 : "cc");
     52                : "=&r" (tmp),
     53                  "=m" (val->count)
     54                : "r" (&val->count),
     55                  "m" (val->count)
     56                : "cc"
     57        );
    5558}
    5659
    5760static inline void atomic_dec(atomic_t *val)
    5861{
    59         long tmp;
    60 
     62        atomic_count_t tmp;
     63       
    6164        asm volatile (
    6265                "1:\n"
    6366                "lwarx %0, 0, %2\n"
    6467                "addic %0, %0, -1\n"
    65                 "stwcx. %0, 0, %2\n"
     68                "stwcx. %0, 0, %2\n"
    6669                "bne- 1b"
    67                 : "=&r" (tmp), "=m" (val->count)
    68                 : "r" (&val->count), "m" (val->count)
    69                 : "cc");
     70                : "=&r" (tmp),
     71                  "=m" (val->count)
     72                : "r" (&val->count),
     73                  "m" (val->count)
     74                : "cc"
     75        );
    7076}
    7177
    72 static inline long atomic_postinc(atomic_t *val)
     78static inline atomic_count_t atomic_postinc(atomic_t *val)
    7379{
    7480        atomic_inc(val);
     
    7682}
    7783
    78 static inline long atomic_postdec(atomic_t *val)
     84static inline atomic_count_t atomic_postdec(atomic_t *val)
    7985{
    8086        atomic_dec(val);
     
    8288}
    8389
    84 static inline long atomic_preinc(atomic_t *val)
     90static inline atomic_count_t atomic_preinc(atomic_t *val)
    8591{
    8692        atomic_inc(val);
     
    8894}
    8995
    90 static inline long atomic_predec(atomic_t *val)
     96static inline atomic_count_t atomic_predec(atomic_t *val)
    9197{
    9298        atomic_dec(val);
Note: See TracChangeset for help on using the changeset viewer.