Index: src/atomic/gcc_x86.c
===================================================================
--- src/atomic/gcc_x86.c	(revision 0)
+++ src/atomic/gcc_x86.c	(revision 0)
@@ -0,0 +1,59 @@
+/* atomic/gcc_x86.c
+ *  Copyright (C) 2006, The Perl Foundation.
+ *  SVN Info
+ *     $Id$
+ *  Overview:
+ *     An implementation of atomic
+ *     operations on x86 platforms with GCC-style
+ *     inline assembly suppport.
+ *  Data Structure and Algorithms:
+ *  History:
+ *  Notes:
+ *  References:
+ */
+
+#include "parrot/parrot.h"
+#include "parrot/atomic/gcc_x86.h"
+
+/*
+ * if both I386 and X86_64 cmpxchg are defined, we are on x86_64 -
+ * reuse existing code
+ */
+PARROT_INLINE
+void *parrot_i386_cmpxchg(void *volatile *ptr, void *expect,
+                                        void *update)
+{
+#if defined(PARROT_HAS_X86_64_GCC_CMPXCHG)
+    __asm__ __volatile__("lock\n"
+                         "cmpxchgq %1,%2":"=a"(expect):"q"(update), "m"(*ptr),
+                         "0"(expect)
+                         :"memory");
+#else
+    __asm__ __volatile__("lock\n"
+                         "cmpxchgl %1,%2":"=a"(expect):"q"(update), "m"(*ptr),
+                         "0"(expect)
+                         :"memory");
+#endif
+    return expect;
+}
+
+PARROT_INLINE
+long parrot_i386_xadd(volatile long *l, long amount)
+{
+    long result = amount;
+#if defined(PARROT_HAS_X86_64_GCC_CMPXCHG)
+    __asm__ __volatile__("lock\n" "xaddq %0, %1" : "=r"(result), "=m"(*l) :
+            "0"(result), "m"(*l));
+#else
+    __asm__ __volatile__("lock\n" "xaddl %0, %1" : "=r"(result), "=m"(*l) :
+            "0"(result), "m"(*l));
+#endif
+    return result + amount;
+}
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */

Property changes on: src/atomic/gcc_x86.c
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Index: include/parrot/atomic/gcc_x86.h
===================================================================
--- include/parrot/atomic/gcc_x86.h	(revision 22746)
+++ include/parrot/atomic/gcc_x86.h	(working copy)
@@ -28,22 +28,8 @@
  * reuse existing code
  */
 PARROT_INLINE
-static void *parrot_i386_cmpxchg(void *volatile *ptr, void *expect,
-                                        void *update)
-{
-#if defined(PARROT_HAS_X86_64_GCC_CMPXCHG)
-    __asm__ __volatile__("lock\n"
-                         "cmpxchgq %1,%2":"=a"(expect):"q"(update), "m"(*ptr),
-                         "0"(expect)
-                         :"memory");
-#else
-    __asm__ __volatile__("lock\n"
-                         "cmpxchgl %1,%2":"=a"(expect):"q"(update), "m"(*ptr),
-                         "0"(expect)
-                         :"memory");
-#endif
-    return expect;
-}
+void *parrot_i386_cmpxchg(void *volatile *ptr, void *expect,
+                                        void *update);
 
 #define PARROT_ATOMIC_PTR_GET(result, a) (result = (a).val)
 
@@ -84,18 +70,7 @@
     } while (0)
 
 PARROT_INLINE
-static long parrot_i386_xadd(volatile long *l, long amount)
-{
-    long result = amount;
-#if defined(PARROT_HAS_X86_64_GCC_CMPXCHG)
-    __asm__ __volatile__("lock\n" "xaddq %0, %1" : "=r"(result), "=m"(*l) :
-            "0"(result), "m"(*l));
-#else
-    __asm__ __volatile__("lock\n" "xaddl %0, %1" : "=r"(result), "=m"(*l) :
-            "0"(result), "m"(*l));
-#endif
-    return result + amount;
-}
+long parrot_i386_xadd(volatile long *l, long amount);
 
 #define PARROT_ATOMIC_INT_INC(result, a) \
     do { \
Index: config/gen/makefiles/root.in
===================================================================
--- config/gen/makefiles/root.in	(revision 22746)
+++ config/gen/makefiles/root.in	(working copy)
@@ -379,6 +379,7 @@
     \
     $(OPS_DIR)/core_ops$(O) \
     $(OPS_DIR)/core_ops_switch$(O) \
+    $(SRC_DIR)/atomic/gcc_x86$(O) \
     $(SRC_DIR)/builtin$(O) \
     $(SRC_DIR)/byteorder$(O) \
     $(SRC_DIR)/charset$(O) \
