Subversion Repositories HelenOS

Rev

Rev 2071 | Rev 3774 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2071 Rev 2082
Line 44... Line 44...
44
 */
44
 */
45
static inline long atomic_add(atomic_t *val, int imm)
45
static inline long atomic_add(atomic_t *val, int imm)
46
{
46
{
47
    long v;
47
    long v;
48
 
48
 
49
    __asm__ volatile ("fetchadd8.rel %0 = %1, %2\n" : "=r" (v), "+m" (val->count) : "i" (imm));
49
    asm volatile ("fetchadd8.rel %0 = %1, %2\n" : "=r" (v), "+m" (val->count) : "i" (imm));
50
 
50
 
51
    return v;
51
    return v;
52
}
52
}
53
 
53
 
54
static inline void atomic_inc(atomic_t *val) { atomic_add(val, 1); }
54
static inline void atomic_inc(atomic_t *val) { atomic_add(val, 1); }