You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by sf...@apache.org on 2013/04/21 23:25:59 UTC
svn commit: r1470348 - in /apr/apr/trunk: CHANGES atomic/unix/ia32.c
test/testatomic.c
Author: sf
Date: Sun Apr 21 21:25:59 2013
New Revision: 1470348
URL: http://svn.apache.org/r1470348
Log:
Fix amd64 assembler version of apr_atomic_xchgptr()
PR: 51851
Submitted by: Mattias Engdegård <mattiase acm org>
Modified:
apr/apr/trunk/CHANGES
apr/apr/trunk/atomic/unix/ia32.c
apr/apr/trunk/test/testatomic.c
Modified: apr/apr/trunk/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/trunk/CHANGES?rev=1470348&r1=1470347&r2=1470348&view=diff
==============================================================================
--- apr/apr/trunk/CHANGES [utf-8] (original)
+++ apr/apr/trunk/CHANGES [utf-8] Sun Apr 21 21:25:59 2013
@@ -1,6 +1,9 @@
-*- coding: utf-8 -*-
Changes for APR 2.0.0
+ *) Fix amd64 assembler version of apr_atomic_xchgptr(). PR 51851. [Mattias
+ Engdegård <mattiase acm org>]
+
*) Fix PPC atomics to work with gcc 4.0. PR 54840. [Mattias Engdegård
<mattiase acm org>]
Modified: apr/apr/trunk/atomic/unix/ia32.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/atomic/unix/ia32.c?rev=1470348&r1=1470347&r2=1470348&view=diff
==============================================================================
--- apr/apr/trunk/atomic/unix/ia32.c (original)
+++ apr/apr/trunk/atomic/unix/ia32.c Sun Apr 21 21:25:59 2013
@@ -117,7 +117,7 @@ APR_DECLARE(void*) apr_atomic_xchgptr(vo
#elif APR_SIZEOF_VOIDP == 8
asm volatile ("xchgq %q2, %1"
: "=a" (prev), "+m" (*mem)
- : "r" ((unsigned long)with));
+ : "0" (with));
#else
#error APR_SIZEOF_VOIDP value not supported
#endif
Modified: apr/apr/trunk/test/testatomic.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/testatomic.c?rev=1470348&r1=1470347&r2=1470348&view=diff
==============================================================================
--- apr/apr/trunk/test/testatomic.c (original)
+++ apr/apr/trunk/test/testatomic.c Sun Apr 21 21:25:59 2013
@@ -84,11 +84,12 @@ static void test_xchg32(abts_case *tc, v
static void test_xchgptr(abts_case *tc, void *data)
{
int a;
- volatile void *target_ptr = NULL;
+ void *ref = "little piggy";
+ volatile void *target_ptr = ref;
void *old_ptr;
old_ptr = apr_atomic_xchgptr(&target_ptr, &a);
- ABTS_PTR_EQUAL(tc, NULL, old_ptr);
+ ABTS_PTR_EQUAL(tc, ref, old_ptr);
ABTS_PTR_EQUAL(tc, &a, (void *) target_ptr);
}