Ignore:
File:
1 edited

Legend:

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

    r228666c re15e0e8  
    2727 */
    2828
    29 /** @addtogroup libcmips32
     29/** @addtogroup libcmips32     
    3030 * @{
    3131 */
    3232/** @file
    33  * @ingroup libcmips32eb
     33 * @ingroup libcmips32eb       
    3434 */
    3535
     
    4141#include <atomicdflt.h>
    4242
    43 #define atomic_inc(x)  ((void) atomic_add(x, 1))
    44 #define atomic_dec(x)  ((void) atomic_add(x, -1))
     43#define atomic_inc(x)   ((void) atomic_add(x, 1))
     44#define atomic_dec(x)   ((void) atomic_add(x, -1))
    4545
    46 #define atomic_postinc(x)  (atomic_add(x, 1) - 1)
    47 #define atomic_postdec(x)  (atomic_add(x, -1) + 1)
     46#define atomic_postinc(x) (atomic_add(x, 1) - 1)
     47#define atomic_postdec(x) (atomic_add(x, -1) + 1)
    4848
    49 #define atomic_preinc(x)  atomic_add(x, 1)
    50 #define atomic_predec(x)  atomic_add(x, -1)
     49#define atomic_preinc(x) atomic_add(x, 1)
     50#define atomic_predec(x) atomic_add(x, -1)
    5151
    5252/* Atomic addition of immediate value.
    5353 *
    5454 * @param val Memory location to which will be the immediate value added.
    55  * @param i   Signed immediate that will be added to *val.
     55 * @param i Signed immediate that will be added to *val.
    5656 *
    5757 * @return Value after addition.
    58  *
    5958 */
    60 static inline atomic_count_t atomic_add(atomic_t *val, atomic_count_t i)
     59static inline long atomic_add(atomic_t *val, int i)
    6160{
    62         atomic_count_t tmp;
    63         atomic_count_t v;
    64        
     61        long tmp, v;
     62
    6563        asm volatile (
    6664                "1:\n"
     
    7270                /*      nop     */              /* nop is inserted automatically by compiler */
    7371                "       nop\n"
    74                 : "=&r" (tmp),
    75                   "+m" (val->count),
    76                   "=&r" (v)
    77                 : "r" (i),
    78                   "i" (0)
    79         );
    80        
     72                : "=&r" (tmp), "+m" (val->count), "=&r" (v)
     73                : "r" (i), "i" (0)
     74                );
     75
    8176        return v;
    8277}
Note: See TracChangeset for help on using the changeset viewer.