Changeset 80d2bdb in mainline for arch/mips32/include/atomic.h


Ignore:
Timestamp:
2005-12-15T16:10:19Z (20 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b4cad8b2
Parents:
7dd2561
Message:

We are now almost -Wall clean.

  • redefined atomic_t
  • deleted many, many unused variables
  • some minor code cleanups found using compiler warning.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • arch/mips32/include/atomic.h

    r7dd2561 r80d2bdb  
    4242
    4343
    44 typedef volatile __u32 atomic_t;
     44typedef struct { volatile __u32 count; } atomic_t;
    4545
    4646/* Atomic addition of immediate value.
     
    6363                "       beq %0, %4, 1b\n"       /* if the atomic operation failed, try again */
    6464                /*      nop     */              /* nop is inserted automatically by compiler */
    65                 : "=r" (tmp), "=m" (*val), "=r" (v)
     65                : "=r" (tmp), "=m" (val->count), "=r" (v)
    6666                : "i" (i), "i" (0)
    6767                );
     
    7070}
    7171
     72/* Reads/writes are atomic on mips for 4-bytes */
     73
     74static inline void atomic_set(atomic_t *val, __u32 i)
     75{
     76        val->count = i;
     77}
     78
     79static inline __u32 atomic_get(atomic_t *val)
     80{
     81        return val->count;
     82}
    7283
    7384#endif
Note: See TracChangeset for help on using the changeset viewer.