Subversion Repositories HelenOS-historic

Rev

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

Rev 625 Rev 627
Line 48... Line 48...
48
 * @param val Memory location to which will be the immediate value added.
48
 * @param val Memory location to which will be the immediate value added.
49
 * @param i Signed immediate that will be added to *val.
49
 * @param i Signed immediate that will be added to *val.
50
 *
50
 *
51
 * @return Value after addition.
51
 * @return Value after addition.
52
 */
52
 */
53
static inline atomic_t atomic_add(atomic_t *val, int i)
53
static inline count_t atomic_add(atomic_t *val, int i)
54
{
54
{
55
    atomic_t tmp, v;
55
    count_t tmp, v;
56
 
56
 
57
    __asm__ volatile (
57
    __asm__ volatile (
58
        "1:\n"
58
        "1:\n"
59
        "   ll %0, %1\n"
59
        "   ll %0, %1\n"
60
        "   addiu %0, %0, %3\n" /* same as addi, but never traps on overflow */
60
        "   addiu %0, %0, %3\n" /* same as addi, but never traps on overflow */