Overview
Comment: | atomic.h: Minor style improvements |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
461e70403e361eb31afab5f5ded1dd09 |
User & Date: | js on 2014-05-07 02:46:02 |
Other Links: | manifest | tags |
Context
2014-05-07
| ||
03:19 | Add atomic ops assembly implementation for PowerPC check-in: 93e23b476c user: js tags: trunk | |
02:46 | atomic.h: Minor style improvements check-in: 461e70403e user: js tags: trunk | |
2014-05-06
| ||
21:38 | Add a few OF_CONST_FUNC check-in: cbff518f16 user: js tags: trunk | |
Changes
Modified src/atomic.h from [53694a578a] to [1f71674619].
︙ | |||
278 279 280 281 282 283 284 | 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | - + | of_atomic_int32_inc(volatile int32_t *p) { #if !defined(OF_HAVE_THREADS) return ++*p; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_add_and_fetch(p, 1); #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) |
︙ | |||
349 350 351 352 353 354 355 | 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 | - + | of_atomic_int32_dec(volatile int32_t *p) { #if !defined(OF_HAVE_THREADS) return --*p; #elif defined(OF_HAVE_GCC_ATOMIC_OPS) return __sync_sub_and_fetch(p, 1); #elif defined(OF_X86_64_ASM) || defined(OF_X86_ASM) |
︙ | |||
385 386 387 388 389 390 391 | 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 | - + - + | __asm__ __volatile__ ( "0:\n\t" "movl %2, %0\n\t" "movl %0, %%eax\n\t" "orl %1, %0\n\t" "lock\n\t" "cmpxchg %0, %2\n\t" |
︙ | |||
431 432 433 434 435 436 437 | 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 | - + | __asm__ __volatile__ ( "0:\n\t" "movl %2, %0\n\t" "movl %0, %%eax\n\t" "orl %1, %0\n\t" "lock\n\t" "cmpxchg %0, %2\n\t" |
︙ | |||
461 462 463 464 465 466 467 | 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 | - + - + | __asm__ __volatile__ ( "0:\n\t" "movl %2, %0\n\t" "movl %0, %%eax\n\t" "andl %1, %0\n\t" "lock\n\t" "cmpxchg %0, %2\n\t" |
︙ | |||
507 508 509 510 511 512 513 | 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 | - + | __asm__ __volatile__ ( "0:\n\t" "movl %2, %0\n\t" "movl %0, %%eax\n\t" "andl %1, %0\n\t" "lock\n\t" "cmpxchg %0, %2\n\t" |
︙ | |||
537 538 539 540 541 542 543 | 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 | - + - + | __asm__ __volatile__ ( "0:\n\t" "movl %2, %0\n\t" "movl %0, %%eax\n\t" "xorl %1, %0\n\t" "lock\n\t" "cmpxchg %0, %2\n\t" |
︙ | |||
583 584 585 586 587 588 589 | 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 | - + | __asm__ __volatile__ ( "0:\n\t" "movl %2, %0\n\t" "movl %0, %%eax\n\t" "xorl %1, %0\n\t" "lock\n\t" "cmpxchgl %0, %2\n\t" |
︙ | |||
617 618 619 620 621 622 623 | 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 | - + | int r; __asm__ __volatile__ ( "lock\n\t" "cmpxchg %2, %3\n\t" "sete %b0\n\t" "movzbl %b0, %0" |
︙ | |||
650 651 652 653 654 655 656 | 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 | - + | int r; __asm__ __volatile__ ( "lock\n\t" "cmpxchg %2, %3\n\t" "sete %b0\n\t" "movzbl %b0, %0" |
︙ | |||
683 684 685 686 687 688 689 | 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 | - + | int r; __asm__ __volatile__ ( "lock\n\t" "cmpxchg %2, %3\n\t" "sete %b0\n\t" "movzbl %b0, %0" |
︙ |