Subversion Repositories HelenOS

Rev

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

Rev 3162 Rev 3167
Line 56... Line 56...
56
    long tmp, v;
56
    long tmp, v;
57
 
57
 
58
    asm volatile (
58
    asm volatile (
59
        "1:\n"
59
        "1:\n"
60
        "   ll %0, %1\n"
60
        "   ll %0, %1\n"
61
        "   addiu %0, %0, %3\n" /* same as addi, but never traps on overflow */
61
        "   addu %0, %0, %3\n"  /* same as addi, but never traps on overflow */
62
        "       move %2, %0\n"
62
        "       move %2, %0\n"
63
        "   sc %0, %1\n"
63
        "   sc %0, %1\n"
64
        "   beq %0, %4, 1b\n"   /* if the atomic operation failed, try again */
64
        "   beq %0, %4, 1b\n"   /* if the atomic operation failed, try again */
65
        "   nop\n"
65
        "   nop\n"
66
        : "=&r" (tmp), "+m" (val->count), "=&r" (v)
66
        : "=&r" (tmp), "+m" (val->count), "=&r" (v)
67
        : "i" (i), "i" (0)
67
        : "r" (i), "i" (0)
68
        );
68
        );
69
 
69
 
70
    return v;
70
    return v;
71
}
71
}
72
 
72