Ignore:
File:
1 edited

Legend:

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

    r228666c rcd769305  
    2727 */
    2828
    29 /** @addtogroup libcarm32
     29/** @addtogroup libcarm32       
    3030 * @{
    3131 */
     
    3838
    3939#define LIBC_ARCH_ATOMIC_H_
    40 #define CAS
     40#define CAS 
    4141
    4242#include <atomicdflt.h>
     
    4646extern uintptr_t *ras_page;
    4747
    48 static inline bool cas(atomic_t *val, atomic_count_t ov, atomic_count_t nv)
     48static inline bool cas(atomic_t *val, long ov, long nv)
    4949{
    50         atomic_count_t ret = 0;
    51        
     50        long ret = 0;
     51
    5252        /*
    5353         * The following instructions between labels 1 and 2 constitute a
     
    7575                : "memory"
    7676        );
    77        
     77
    7878        ras_page[0] = 0;
    79         asm volatile (
    80                 "" ::: "memory"
    81         );
     79        asm volatile ("" ::: "memory");
    8280        ras_page[1] = 0xffffffff;
    83        
     81
    8482        return (bool) ret;
    8583}
     
    9189 *
    9290 * @return Value after addition.
    93  *
    9491 */
    95 static inline atomic_count_t atomic_add(atomic_t *val, atomic_count_t i)
     92static inline long atomic_add(atomic_t *val, int i)
    9693{
    97         atomic_count_t ret = 0;
    98        
     94        long ret = 0;
     95
    9996        /*
    10097         * The following instructions between labels 1 and 2 constitute a
     
    118115                : [imm] "r" (i)
    119116        );
    120        
     117
    121118        ras_page[0] = 0;
    122         asm volatile (
    123                 "" ::: "memory"
    124         );
     119        asm volatile ("" ::: "memory");
    125120        ras_page[1] = 0xffffffff;
    126        
     121
    127122        return ret;
    128123}
     
    132127 *
    133128 * @param val Variable to be incremented.
    134  *
    135129 */
    136130static inline void atomic_inc(atomic_t *val)
     
    143137 *
    144138 * @param val Variable to be decremented.
    145  *
    146139 */
    147140static inline void atomic_dec(atomic_t *val)
     
    155148 * @param val Variable to be incremented.
    156149 * @return    Value after incrementation.
    157  *
    158150 */
    159 static inline atomic_count_t atomic_preinc(atomic_t *val)
     151static inline long atomic_preinc(atomic_t *val)
    160152{
    161153        return atomic_add(val, 1);
     
    167159 * @param val Variable to be decremented.
    168160 * @return    Value after decrementation.
    169  *
    170161 */
    171 static inline atomic_count_t atomic_predec(atomic_t *val)
     162static inline long atomic_predec(atomic_t *val)
    172163{
    173164        return atomic_add(val, -1);
     
    179170 * @param val Variable to be incremented.
    180171 * @return    Value before incrementation.
    181  *
    182172 */
    183 static inline atomic_count_t atomic_postinc(atomic_t *val)
     173static inline long atomic_postinc(atomic_t *val)
    184174{
    185175        return atomic_add(val, 1) - 1;
     
    191181 * @param val Variable to be decremented.
    192182 * @return    Value before decrementation.
    193  *
    194183 */
    195 static inline atomic_count_t atomic_postdec(atomic_t *val)
     184static inline long atomic_postdec(atomic_t *val)
    196185{
    197186        return atomic_add(val, -1) + 1;
Note: See TracChangeset for help on using the changeset viewer.