uatomic: fix i386 support
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 27 Jun 2011 20:54:56 +0000 (16:54 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 27 Jun 2011 20:54:56 +0000 (16:54 -0400)
Fix:

* Incorrect prototype for uatomic_and and uatomic_or in i386
  compatibility code.
* Missing $(COMPAT) code inclusion in wfq/lfq tests.
* Silence gcc warnings about compat code (branch volountarily causing a
  linker error, which can never return).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
compat_arch_x86.c
tests/Makefile.am
urcu/uatomic/x86.h

index 9cbd3c8c808d794ac5ad63292479b67e99a96ed4..e882a4afe467f511832b4d4e662225b7fd41ca3a 100644 (file)
@@ -152,6 +152,7 @@ unsigned long _compat_uatomic_xchg(void *addr, unsigned long _new, int len)
                 * generate an illegal instruction. Cannot catch this with
                 * linker tricks when optimizations are disabled.
                 */
+               retval = 0;     /* silence gcc warnings */
                __asm__ __volatile__("ud2");
        }
        mutex_lock_signal_restore(&compat_mutex, &mask);
@@ -195,6 +196,7 @@ unsigned long _compat_uatomic_cmpxchg(void *addr, unsigned long old,
                 * generate an illegal instruction. Cannot catch this with
                 * linker tricks when optimizations are disabled.
                 */
+               retval = 0;     /* silence gcc warnings */
                __asm__ __volatile__("ud2");
        }
        mutex_lock_signal_restore(&compat_mutex, &mask);
@@ -275,6 +277,7 @@ unsigned long _compat_uatomic_add_return(void *addr, unsigned long v, int len)
                 * generate an illegal instruction. Cannot catch this with
                 * linker tricks when optimizations are disabled.
                 */
+               result = 0;     /* silence gcc warnings */
                __asm__ __volatile__("ud2");
        }
        mutex_lock_signal_restore(&compat_mutex, &mask);
index 38002603c5292e61be33879541f062db78856a46..674260fff1f1dc367310aab6c705ff223f2ac9e2 100644 (file)
@@ -160,7 +160,7 @@ test_urcu_lfq_dynlink_SOURCES = test_urcu_lfq.c $(URCU)
 test_urcu_lfq_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS)
 test_urcu_lfq_dynlink_LDADD = $(URCU_CDS_LIB)
 
-test_urcu_wfq_SOURCES = test_urcu_wfq.c
+test_urcu_wfq_SOURCES = test_urcu_wfq.c $(COMPAT)
 test_urcu_wfq_dynlink_SOURCES = test_urcu_wfq.c
 test_urcu_wfq_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS)
 test_urcu_wfq_dynlink_LDADD = $(URCU_CDS_LIB)
@@ -170,7 +170,7 @@ test_urcu_lfs_dynlink_SOURCES = test_urcu_lfs.c $(URCU_DEFER)
 test_urcu_lfs_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS)
 test_urcu_lfs_dynlink_LDADD = $(URCU_CDS_LIB)
 
-test_urcu_wfs_SOURCES = test_urcu_wfs.c
+test_urcu_wfs_SOURCES = test_urcu_wfs.c $(COMPAT)
 test_urcu_wfs_dynlink_SOURCES = test_urcu_wfs.c
 test_urcu_wfs_dynlink_CFLAGS = -DDYNAMIC_LINK_TEST $(AM_CFLAGS)
 test_urcu_wfs_dynlink_LDADD = $(URCU_CDS_LIB)
index b4c108fb2c4e43b4f20c3b24cda20563b0059958..e064b9ebd6e1bc798c85a0d464d42940cacf2d3e 100644 (file)
@@ -536,26 +536,24 @@ extern unsigned long _compat_uatomic_cmpxchg(void *addr, unsigned long old,
                                                (unsigned long)(_new),         \
                                                sizeof(*(addr))))
 
-extern unsigned long _compat_uatomic_and(void *addr,
-                                        unsigned long _new, int len);
+extern void _compat_uatomic_and(void *addr, unsigned long _new, int len);
 #define compat_uatomic_and(addr, v)                                   \
-       ((__typeof__(*(addr))) _compat_uatomic_and((addr),             \
-                                                  (unsigned long)(v), \
-                                                  sizeof(*(addr))))
+       (_compat_uatomic_and((addr),                                   \
+                       (unsigned long)(v),                            \
+                       sizeof(*(addr))))
 
-extern unsigned long _compat_uatomic_or(void *addr,
-                                       unsigned long _new, int len);
+extern void _compat_uatomic_or(void *addr, unsigned long _new, int len);
 #define compat_uatomic_or(addr, v)                                    \
-       ((__typeof__(*(addr))) _compat_uatomic_or((addr),              \
-                                                 (unsigned long)(v),  \
-                                                 sizeof(*(addr))))
+       (_compat_uatomic_or((addr),                                    \
+                         (unsigned long)(v),                          \
+                         sizeof(*(addr))))
 
 extern unsigned long _compat_uatomic_add_return(void *addr,
                                                unsigned long _new, int len);
-#define compat_uatomic_add_return(addr, v)                                    \
-       ((__typeof__(*(addr))) _compat_uatomic_add_return((addr),              \
-                                               (unsigned long)(v),            \
-                                               sizeof(*(addr))))
+#define compat_uatomic_add_return(addr, v)                            \
+       ((__typeof__(*(addr))) _compat_uatomic_add_return((addr),      \
+                                                  (unsigned long)(v), \
+                                                  sizeof(*(addr))))
 
 #define compat_uatomic_add(addr, v)                                           \
                ((void)compat_uatomic_add_return((addr), (v)))
This page took 0.028086 seconds and 4 git commands to generate.