ObjFW  Check-in [c10cc0f9e2]

Overview
Comment:Fix local labels in inline assembly.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c10cc0f9e286c646ad04c2393a5c51f2fe54db5fd04475b2ef05c4268d89d391
User & Date: js on 2010-12-08 23:18:36
Other Links: manifest | tags
Context
2010-12-09
19:04
Move -[setBlocking] to OFStream. check-in: beb4a0d036 user: js tags: trunk
2010-12-08
23:18
Fix local labels in inline assembly. check-in: c10cc0f9e2 user: js tags: trunk
2010-12-07
23:53
Rename -[string] to -[description] in OFException. check-in: 684d24b23e user: js tags: trunk
Changes

Modified src/atomic.h from [c57a56dcf7] to [d7c1fc83e5].

498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
#elif defined(OF_X86_ASM) || defined(OF_AMD64_ASM)
	int r;

	__asm__ (
	    "xorl	%0, %0\n\t"
	    "lock\n\t"
	    "cmpxchg	%2, %3\n\t"
	    "jne	.1\n\t"
	    "incl	%0\n"
	    ".1:"
	    : "=&r"(r)
	    : "a"(o), "r"(n), "m"(*p)
	);

	return r;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_bool_compare_and_swap(p, o, n);







|

|







498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
#elif defined(OF_X86_ASM) || defined(OF_AMD64_ASM)
	int r;

	__asm__ (
	    "xorl	%0, %0\n\t"
	    "lock\n\t"
	    "cmpxchg	%2, %3\n\t"
	    "jne	0\n\t"
	    "incl	%0\n"
	    "0:"
	    : "=&r"(r)
	    : "a"(o), "r"(n), "m"(*p)
	);

	return r;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_bool_compare_and_swap(p, o, n);
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
#elif defined(OF_X86_ASM) || defined(OF_AMD64_ASM)
	int r;

	__asm__ (
	    "xorl	%0, %0\n\t"
	    "lock\n\t"
	    "cmpxchg	%2, %3\n\t"
	    "jne	.1\n\t"
	    "incl	%0\n"
	    ".1:"
	    : "=&r"(r)
	    : "a"(o), "r"(n), "m"(*p)
	);

	return r;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_bool_compare_and_swap(p, o, n);







|

|







530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
#elif defined(OF_X86_ASM) || defined(OF_AMD64_ASM)
	int r;

	__asm__ (
	    "xorl	%0, %0\n\t"
	    "lock\n\t"
	    "cmpxchg	%2, %3\n\t"
	    "jne	0\n\t"
	    "incl	%0\n"
	    "0:"
	    : "=&r"(r)
	    : "a"(o), "r"(n), "m"(*p)
	);

	return r;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_bool_compare_and_swap(p, o, n);
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
#elif defined(OF_X86_ASM) || defined(OF_AMD64_ASM)
	int r;

	__asm__ (
	    "xorl	%0, %0\n\t"
	    "lock\n\t"
	    "cmpxchg	%2, %3\n\t"
	    "jne	.1\n\t"
	    "incl	%0\n"
	    ".1:"
	    : "=&r"(r)
	    : "a"(o), "r"(n), "m"(*p)
	);

	return r;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_bool_compare_and_swap(p, o, n);
#elif defined(OF_HAVE_OSATOMIC)
	return OSAtomicCompareAndSwapPtrBarrier(o, n, p);
#endif
}







|

|











562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
#elif defined(OF_X86_ASM) || defined(OF_AMD64_ASM)
	int r;

	__asm__ (
	    "xorl	%0, %0\n\t"
	    "lock\n\t"
	    "cmpxchg	%2, %3\n\t"
	    "jne	0\n\t"
	    "incl	%0\n"
	    "0:"
	    : "=&r"(r)
	    : "a"(o), "r"(n), "m"(*p)
	);

	return r;
#elif defined(OF_HAVE_GCC_ATOMIC_OPS)
	return __sync_bool_compare_and_swap(p, o, n);
#elif defined(OF_HAVE_OSATOMIC)
	return OSAtomicCompareAndSwapPtrBarrier(o, n, p);
#endif
}