Changeset 59e07c91 in mainline for arch/mips32/include/atomic.h


Ignore:
Timestamp:
2005-11-10T13:56:26Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0172eba
Parents:
13fe013
Message:

Define atomic_t type.

File:
1 edited

Legend:

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

    r13fe013 r59e07c91  
    3030#define __mips32_ATOMIC_H__
    3131
     32#include <arch/types.h>
     33
    3234#define atomic_inc(x)   (a_add(x,1))
    3335#define atomic_dec(x)   (a_sub(x,1))
     36
     37typedef volatile __u32 atomic_t;
    3438
    3539/*
     
    4246 * the same location, the SC (store-conditional) instruction fails.
    4347 */
    44 static inline int a_add( volatile int *val, int i)
     48static inline atomic_t a_add(atomic_t *val, int i)
    4549{
    46         int tmp, tmp2;
     50        atomic_t tmp, tmp2;
    4751
    4852        asm volatile (
     
    7074 * Implemented in the same manner as a_add, except we substract the value.
    7175 */
    72 static inline int a_sub( volatile int *val, int i)
     76static inline atomic_t a_sub(atomic_t *val, int i)
    7377
    7478{
    75         int tmp, tmp2;
     79        atomic_t tmp, tmp2;
    7680
    7781        asm volatile (
Note: See TracChangeset for help on using the changeset viewer.