Changeset 23684b7 in mainline for arch/ppc32/include/atomic.h


Ignore:
Timestamp:
2006-03-22T17:21:15Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d71007e
Parents:
45fb65c
Message:

Define atomic_t only once in atomic.h
Change the encapsulated counter type to long so that it supports negative values as well.

File:
1 edited

Legend:

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

    r45fb65c r23684b7  
    3131
    3232#include <arch/types.h>
    33 
    34 typedef struct { volatile __u32 count; } atomic_t;
     33#include <typedefs.h>
    3534
    3635static inline void atomic_inc(atomic_t *val)
     
    6463}
    6564
    66 static inline __u32 atomic_postinc(atomic_t *val)
     65static inline long atomic_postinc(atomic_t *val)
    6766{
    6867        atomic_inc(val);
     
    7069}
    7170
    72 static inline __u32 atomic_postdec(atomic_t *val)
     71static inline long atomic_postdec(atomic_t *val)
    7372{
    7473        atomic_dec(val);
     
    7675}
    7776
    78 static inline __u32 atomic_preinc(atomic_t *val)
     77static inline long atomic_preinc(atomic_t *val)
    7978{
    8079        atomic_inc(val);
     
    8281}
    8382
    84 static inline __u32 atomic_predec(atomic_t *val)
     83static inline long atomic_predec(atomic_t *val)
    8584{
    8685        atomic_dec(val);
     
    8887}
    8988
    90 static inline void atomic_set(atomic_t *val, __u32 i)
    91 {
    92         val->count = i;
    93 }
    94 
    95 static inline __u32 atomic_get(atomic_t *val)
    96 {
    97         return val->count;
    98 }
    99 
    10089#endif
Note: See TracChangeset for help on using the changeset viewer.