~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201210021442

« back to all changes in this revision

Viewing changes to lib/include/vm_atomic.h

  • Committer: Package Import Robot
  • Author(s): Nate Muench
  • Date: 2012-06-20 15:59:51 UTC
  • mfrom: (1.4.8)
  • Revision ID: package-import@ubuntu.com-20120620155951-6rupmpb0f70b52zr
Tags: 2012.05.21-724730-0ubuntu1
* Merging upstream version 2012.05.21-724730.
  - Fixes building against the current Quantal kernel. (LP: #1000344)
  - Fixes Quantal installation issues. (LP: #1019031)

* Sync with Debian
  - Updating to debhelper version 9.
  - Updating to standards version 3.9.3.
  - Updating copyright file machine-readable format version 1.0.
  - Building without multiarch paths for now

Show diffs side-by-side

added added

removed removed

Lines of Context:
1287
1287
#ifdef VM_ARM_V7
1288
1288
   register volatile uint32 res;
1289
1289
   register volatile uint32 retVal;
 
1290
   register volatile uint32 tmp;
1290
1291
 
1291
1292
   dmb();
1292
1293
 
1293
1294
   __asm__ __volatile__(
1294
1295
      "1: ldrex %[retVal], [%[var]] \n\t"
1295
 
      "add %[val], %[val], %[retVal] \n\t"
1296
 
      "strex %[res], %[val], [%[var]] \n\t"
 
1296
      "add %[tmp], %[val], %[retVal] \n\t"
 
1297
      "strex %[res], %[tmp], [%[var]] \n\t"
1297
1298
      "teq %[res], #0 \n\t"
1298
1299
      "bne 1b"
1299
 
      : [res] "=&r" (res), [retVal] "=&r" (retVal)
 
1300
      : [tmp] "=&r" (tmp), [res] "=&r" (res), [retVal] "=&r" (retVal)
1300
1301
      : [var] "r" (&var->value), [val] "r" (val)
1301
1302
      : "cc"
1302
1303
   );
1410
1411
#error No compiler defined for Atomic_ReadAdd64
1411
1412
#endif
1412
1413
}
 
1414
 
 
1415
/*
 
1416
 *-----------------------------------------------------------------------------
 
1417
 *
 
1418
 * Atomic_ReadSub64 --
 
1419
 *
 
1420
 *      Atomic read (returned), sub a value, write.
 
1421
 *
 
1422
 * Results:
 
1423
 *      The value of the variable before the operation.
 
1424
 *
 
1425
 * Side effects:
 
1426
 *      None
 
1427
 *
 
1428
 *-----------------------------------------------------------------------------
 
1429
 */
 
1430
 
 
1431
static INLINE uint64
 
1432
Atomic_ReadSub64(Atomic_uint64 *var, // IN
 
1433
                 uint64 val)         // IN
 
1434
{
 
1435
   // Do an sub by an add and a overflow
 
1436
   return Atomic_ReadAdd64(var, -val);
 
1437
}
1413
1438
#endif
1414
1439
 
1415
1440
 
2397
2422
      "bt %2, %1; setc %0"
2398
2423
      : "=rm"(out)
2399
2424
      : "m" (var->value),
2400
 
        "ri" (bit)
 
2425
        "rJ" (bit)
2401
2426
      : "cc"
2402
2427
   );
2403
2428
   return out;