| @@ -1208,15 +1208,21 @@ arch_atomic_inc_and_test(atomic_t *v) · 1207 unmodified lines |
| 1208 | #define arch_atomic_inc_and_test arch_atomic_inc_and_test | 1208 | #define arch_atomic_inc_and_test arch_atomic_inc_and_test |
| 1209 | #endif | 1209 | #endif |
| 1210 | | 1210 | |
| | 1211 | #ifndef arch_atomic_add_negative_relaxed |
| | 1212 | #ifdef arch_atomic_add_negative |
| | 1213 | #define arch_atomic_add_negative_acquire arch_atomic_add_negative |
| | 1214 | #define arch_atomic_add_negative_release arch_atomic_add_negative |
| | 1215 | #define arch_atomic_add_negative_relaxed arch_atomic_add_negative |
| | 1216 | #endif /* arch_atomic_add_negative */ |
| | 1217 | |
| 1211 | #ifndef arch_atomic_add_negative | 1218 | #ifndef arch_atomic_add_negative |
| 1212 | /** | 1219 | /** |
| 1213 | * arch_atomic_add_negative - add and test if negative | 1220 | * arch_atomic_add_negative - Add and test if negative |
| 1214 | * @i: integer value to add | 1221 | * @i: integer value to add |
| 1215 | * @v: pointer of type atomic_t | 1222 | * @v: pointer of type atomic_t |
| 1216 | * | 1223 | * |
| 1217 | * Atomically adds @i to @v and returns true | 1224 | * Atomically adds @i to @v and returns true if the result is negative, |
| 1218 | * if the result is negative, or false when | 1225 | * or false when the result is greater than or equal to zero. |
| 1219 | * result is greater than or equal to zero. | | |
| 1220 | */ | 1226 | */ |
| 1221 | static __always_inline bool | 1227 | static __always_inline bool |
| 1222 | arch_atomic_add_negative(int i, atomic_t *v) | 1228 | arch_atomic_add_negative(int i, atomic_t *v) |
| @@ -1226,6 +1232,95 @@ arch_atomic_add_negative(int i, atomic_t *v) · 3 unmodified lines |
| 1226 | #define arch_atomic_add_negative arch_atomic_add_negative | 1232 | #define arch_atomic_add_negative arch_atomic_add_negative |
| 1227 | #endif | 1233 | #endif |
| 1228 | | 1234 | |
| | 1235 | #ifndef arch_atomic_add_negative_acquire |
| | 1236 | /** |
| | 1237 | * arch_atomic_add_negative_acquire - Add and test if negative |
| | 1238 | * @i: integer value to add |
| | 1239 | * @v: pointer of type atomic_t |
| | 1240 | * |
| | 1241 | * Atomically adds @i to @v and returns true if the result is negative, |
| | 1242 | * or false when the result is greater than or equal to zero. |
| | 1243 | */ |
| | 1244 | static __always_inline bool |
| | 1245 | arch_atomic_add_negative_acquire(int i, atomic_t *v) |
| | 1246 | { |
| | 1247 | return arch_atomic_add_return_acquire(i, v) < 0; |
| | 1248 | } |
| | 1249 | #define arch_atomic_add_negative_acquire arch_atomic_add_negative_acquire |
| | 1250 | #endif |
| | 1251 | |
| | 1252 | #ifndef arch_atomic_add_negative_release |
| | 1253 | /** |
| | 1254 | * arch_atomic_add_negative_release - Add and test if negative |
| | 1255 | * @i: integer value to add |
| | 1256 | * @v: pointer of type atomic_t |
| | 1257 | * |
| | 1258 | * Atomically adds @i to @v and returns true if the result is negative, |
| | 1259 | * or false when the result is greater than or equal to zero. |
| | 1260 | */ |
| | 1261 | static __always_inline bool |
| | 1262 | arch_atomic_add_negative_release(int i, atomic_t *v) |
| | 1263 | { |
| | 1264 | return arch_atomic_add_return_release(i, v) < 0; |
| | 1265 | } |
| | 1266 | #define arch_atomic_add_negative_release arch_atomic_add_negative_release |
| | 1267 | #endif |
| | 1268 | |
| | 1269 | #ifndef arch_atomic_add_negative_relaxed |
| | 1270 | /** |
| | 1271 | * arch_atomic_add_negative_relaxed - Add and test if negative |
| | 1272 | * @i: integer value to add |
| | 1273 | * @v: pointer of type atomic_t |
| | 1274 | * |
| | 1275 | * Atomically adds @i to @v and returns true if the result is negative, |
| | 1276 | * or false when the result is greater than or equal to zero. |
| | 1277 | */ |
| | 1278 | static __always_inline bool |
| | 1279 | arch_atomic_add_negative_relaxed(int i, atomic_t *v) |
| | 1280 | { |
| | 1281 | return arch_atomic_add_return_relaxed(i, v) < 0; |
| | 1282 | } |
| | 1283 | #define arch_atomic_add_negative_relaxed arch_atomic_add_negative_relaxed |
| | 1284 | #endif |
| | 1285 | |
| | 1286 | #else /* arch_atomic_add_negative_relaxed */ |
| | 1287 | |
| | 1288 | #ifndef arch_atomic_add_negative_acquire |
| | 1289 | static __always_inline bool |
| | 1290 | arch_atomic_add_negative_acquire(int i, atomic_t *v) |
| | 1291 | { |
| | 1292 | bool ret = arch_atomic_add_negative_relaxed(i, v); |
| | 1293 | __atomic_acquire_fence(); |
| | 1294 | return ret; |
| | 1295 | } |
| | 1296 | #define arch_atomic_add_negative_acquire arch_atomic_add_negative_acquire |
| | 1297 | #endif |
| | 1298 | |
| | 1299 | #ifndef arch_atomic_add_negative_release |
| | 1300 | static __always_inline bool |
| | 1301 | arch_atomic_add_negative_release(int i, atomic_t *v) |
| | 1302 | { |
| | 1303 | __atomic_release_fence(); |
| | 1304 | return arch_atomic_add_negative_relaxed(i, v); |
| | 1305 | } |
| | 1306 | #define arch_atomic_add_negative_release arch_atomic_add_negative_release |
| | 1307 | #endif |
| | 1308 | |
| | 1309 | #ifndef arch_atomic_add_negative |
| | 1310 | static __always_inline bool |
| | 1311 | arch_atomic_add_negative(int i, atomic_t *v) |
| | 1312 | { |
| | 1313 | bool ret; |
| | 1314 | __atomic_pre_full_fence(); |
| | 1315 | ret = arch_atomic_add_negative_relaxed(i, v); |
| | 1316 | __atomic_post_full_fence(); |
| | 1317 | return ret; |
| | 1318 | } |
| | 1319 | #define arch_atomic_add_negative arch_atomic_add_negative |
| | 1320 | #endif |
| | 1321 | |
| | 1322 | #endif /* arch_atomic_add_negative_relaxed */ |
| | 1323 | |
| 1229 | #ifndef arch_atomic_fetch_add_unless | 1324 | #ifndef arch_atomic_fetch_add_unless |
| 1230 | /** | 1325 | /** |
| 1231 | * arch_atomic_fetch_add_unless - add unless the number is already a given value | 1326 | * arch_atomic_fetch_add_unless - add unless the number is already a given value |
| @@ -2329,15 +2424,21 @@ arch_atomic64_inc_and_test(atomic64_t *v) · 1097 unmodified lines |
| 2329 | #define arch_atomic64_inc_and_test arch_atomic64_inc_and_test | 2424 | #define arch_atomic64_inc_and_test arch_atomic64_inc_and_test |
| 2330 | #endif | 2425 | #endif |
| 2331 | | 2426 | |
| | 2427 | #ifndef arch_atomic64_add_negative_relaxed |
| | 2428 | #ifdef arch_atomic64_add_negative |
| | 2429 | #define arch_atomic64_add_negative_acquire arch_atomic64_add_negative |
| | 2430 | #define arch_atomic64_add_negative_release arch_atomic64_add_negative |
| | 2431 | #define arch_atomic64_add_negative_relaxed arch_atomic64_add_negative |
| | 2432 | #endif /* arch_atomic64_add_negative */ |
| | 2433 | |
| 2332 | #ifndef arch_atomic64_add_negative | 2434 | #ifndef arch_atomic64_add_negative |
| 2333 | /** | 2435 | /** |
| 2334 | * arch_atomic64_add_negative - add and test if negative | 2436 | * arch_atomic64_add_negative - Add and test if negative |
| 2335 | * @i: integer value to add | 2437 | * @i: integer value to add |
| 2336 | * @v: pointer of type atomic64_t | 2438 | * @v: pointer of type atomic64_t |
| 2337 | * | 2439 | * |
| 2338 | * Atomically adds @i to @v and returns true | 2440 | * Atomically adds @i to @v and returns true if the result is negative, |
| 2339 | * if the result is negative, or false when | 2441 | * or false when the result is greater than or equal to zero. |
| 2340 | * result is greater than or equal to zero. | | |
| 2341 | */ | 2442 | */ |
| 2342 | static __always_inline bool | 2443 | static __always_inline bool |
| 2343 | arch_atomic64_add_negative(s64 i, atomic64_t *v) | 2444 | arch_atomic64_add_negative(s64 i, atomic64_t *v) |
| @@ -2347,6 +2448,95 @@ arch_atomic64_add_negative(s64 i, atomic64_t *v) · 3 unmodified lines |
| 2347 | #define arch_atomic64_add_negative arch_atomic64_add_negative | 2448 | #define arch_atomic64_add_negative arch_atomic64_add_negative |
| 2348 | #endif | 2449 | #endif |
| 2349 | | 2450 | |
| | 2451 | #ifndef arch_atomic64_add_negative_acquire |
| | 2452 | /** |
| | 2453 | * arch_atomic64_add_negative_acquire - Add and test if negative |
| | 2454 | * @i: integer value to add |
| | 2455 | * @v: pointer of type atomic64_t |
| | 2456 | * |
| | 2457 | * Atomically adds @i to @v and returns true if the result is negative, |
| | 2458 | * or false when the result is greater than or equal to zero. |
| | 2459 | */ |
| | 2460 | static __always_inline bool |
| | 2461 | arch_atomic64_add_negative_acquire(s64 i, atomic64_t *v) |
| | 2462 | { |
| | 2463 | return arch_atomic64_add_return_acquire(i, v) < 0; |
| | 2464 | } |
| | 2465 | #define arch_atomic64_add_negative_acquire arch_atomic64_add_negative_acquire |
| | 2466 | #endif |
| | 2467 | |
| | 2468 | #ifndef arch_atomic64_add_negative_release |
| | 2469 | /** |
| | 2470 | * arch_atomic64_add_negative_release - Add and test if negative |
| | 2471 | * @i: integer value to add |
| | 2472 | * @v: pointer of type atomic64_t |
| | 2473 | * |
| | 2474 | * Atomically adds @i to @v and returns true if the result is negative, |
| | 2475 | * or false when the result is greater than or equal to zero. |
| | 2476 | */ |
| | 2477 | static __always_inline bool |
| | 2478 | arch_atomic64_add_negative_release(s64 i, atomic64_t *v) |
| | 2479 | { |
| | 2480 | return arch_atomic64_add_return_release(i, v) < 0; |
| | 2481 | } |
| | 2482 | #define arch_atomic64_add_negative_release arch_atomic64_add_negative_release |
| | 2483 | #endif |
| | 2484 | |
| | 2485 | #ifndef arch_atomic64_add_negative_relaxed |
| | 2486 | /** |
| | 2487 | * arch_atomic64_add_negative_relaxed - Add and test if negative |
| | 2488 | * @i: integer value to add |
| | 2489 | * @v: pointer of type atomic64_t |
| | 2490 | * |
| | 2491 | * Atomically adds @i to @v and returns true if the result is negative, |
| | 2492 | * or false when the result is greater than or equal to zero. |
| | 2493 | */ |
| | 2494 | static __always_inline bool |
| | 2495 | arch_atomic64_add_negative_relaxed(s64 i, atomic64_t *v) |
| | 2496 | { |
| | 2497 | return arch_atomic64_add_return_relaxed(i, v) < 0; |
| | 2498 | } |
| | 2499 | #define arch_atomic64_add_negative_relaxed arch_atomic64_add_negative_relaxed |
| | 2500 | #endif |
| | 2501 | |
| | 2502 | #else /* arch_atomic64_add_negative_relaxed */ |
| | 2503 | |
| | 2504 | #ifndef arch_atomic64_add_negative_acquire |
| | 2505 | static __always_inline bool |
| | 2506 | arch_atomic64_add_negative_acquire(s64 i, atomic64_t *v) |
| | 2507 | { |
| | 2508 | bool ret = arch_atomic64_add_negative_relaxed(i, v); |
| | 2509 | __atomic_acquire_fence(); |
| | 2510 | return ret; |
| | 2511 | } |
| | 2512 | #define arch_atomic64_add_negative_acquire arch_atomic64_add_negative_acquire |
| | 2513 | #endif |
| | 2514 | |
| | 2515 | #ifndef arch_atomic64_add_negative_release |
| | 2516 | static __always_inline bool |
| | 2517 | arch_atomic64_add_negative_release(s64 i, atomic64_t *v) |
| | 2518 | { |
| | 2519 | __atomic_release_fence(); |
| | 2520 | return arch_atomic64_add_negative_relaxed(i, v); |
| | 2521 | } |
| | 2522 | #define arch_atomic64_add_negative_release arch_atomic64_add_negative_release |
| | 2523 | #endif |
| | 2524 | |
| | 2525 | #ifndef arch_atomic64_add_negative |
| | 2526 | static __always_inline bool |
| | 2527 | arch_atomic64_add_negative(s64 i, atomic64_t *v) |
| | 2528 | { |
| | 2529 | bool ret; |
| | 2530 | __atomic_pre_full_fence(); |
| | 2531 | ret = arch_atomic64_add_negative_relaxed(i, v); |
| | 2532 | __atomic_post_full_fence(); |
| | 2533 | return ret; |
| | 2534 | } |
| | 2535 | #define arch_atomic64_add_negative arch_atomic64_add_negative |
| | 2536 | #endif |
| | 2537 | |
| | 2538 | #endif /* arch_atomic64_add_negative_relaxed */ |
| | 2539 | |
| 2350 | #ifndef arch_atomic64_fetch_add_unless | 2540 | #ifndef arch_atomic64_fetch_add_unless |
| 2351 | /** | 2541 | /** |
| 2352 | * arch_atomic64_fetch_add_unless - add unless the number is already a given value | 2542 | * arch_atomic64_fetch_add_unless - add unless the number is already a given value |
| @@ -2456,4 +2646,4 @@ arch_atomic64_dec_if_positive(atomic64_t *v) · 103 unmodified lines |
| 2456 | #endif | 2646 | #endif |
| 2457 | | 2647 | |
| 2458 | #endif /* _LINUX_ATOMIC_FALLBACK_H */ | 2648 | #endif /* _LINUX_ATOMIC_FALLBACK_H */ |
| 2459 | // b5e87bdd5ede61470c29f7a7e4de781af3770f09 | 2649 | // 00071fffa021cec66f6290d706d69c91df87bade |