]> git.openfabrics.org - ~ardavis/dapl.git/commitdiff
r3606: Fixes IA64 build problems (atomics) with the latest Redhat EL4.0 update and
authorJames Lentini <jlentini@netapp.com>
Wed, 28 Sep 2005 21:50:13 +0000 (21:50 +0000)
committerJames Lentini <jlentini@netapp.com>
Wed, 28 Sep 2005 21:50:13 +0000 (21:50 +0000)
adds support for SuSe.
Signed-off by: Arlin Davis <ardavis@ichips.intel.com>
Signed-off by: James Lentini <jlentini@netapp.com>

dapl/common/dapl_evd_free.c
dapl/udapl/Makefile
dapl/udapl/dapl_cno_free.c
dapl/udapl/linux/dapl_osd.h

index 2f41c0db25b720403ea2312b40841d2500b8e40d..ab4ce7e032e93a0481d7bf03c0fdcd35c2b34d83 100644 (file)
@@ -113,7 +113,7 @@ DAT_RETURN dapl_evd_free (
 #else
     if (cno_ptr != NULL)
     {
-       if (cno_ptr->cno_ref_count == 0 && cno_ptr->cno_waiters > 0)
+       if (dapl_os_atomic_read(&cno_ptr->cno_ref_count) == 0 && cno_ptr->cno_waiters > 0)
        {
            /*
             * Last reference on the CNO, trigger a notice. See
index b6885e1732b90e48786f6d025d4dcbc45cbe0aef..1cee32ef28bbed7e861a434004bad87cd84f9bb2 100644 (file)
@@ -56,6 +56,13 @@ ifndef $VERBS
 VERBS=openib
 endif
 
+#
+# Set an OS Vendor 
+#
+# OS_VENDOR = REDHAT_EL4
+# OS_VENDOR = SuSE
+#
+
 #
 # CFLAGS definition
 #
@@ -67,7 +74,7 @@ endif
 #  CFLAGS      Compile time flags for build
 #
 
-CFLAGS    = -O2 $(CPPFLAGS) -DOS_VERSION=$(OSRELEASE) -DDAPL_DBG
+CFLAGS  = -O2 $(CPPFLAGS) -D$(OS_VENDOR) -DOS_VERSION=$(OSRELEASE) -DDAPL_DBG
 
 #
 # dummy provider
@@ -152,15 +159,12 @@ CFLAGS   += -Wmissing-declarations
 CFLAGS   += --no-strict-aliasing
 CFLAGS   += -Werror
 CFLAGS   += -g3
+CFLAGS   += -fPIC
 
 ifdef GPROF
 CFLAGS   += -pg
 endif
 
-ifeq (${MACH},x86_64)
-CFLAGS += -fPIC
-endif
-
 LD = ld
 
 #
@@ -170,6 +174,10 @@ LDFLAGS  = -shared
 LDFLAGS += -lpthread
 LDFLAGS += -init dapl_init
 LDFLAGS += -fini dapl_fini
+ifeq ($(OS_VENDOR),SuSE)
+LDFLAGS += -lgcc_s
+endif
+
 
 AR = ar
 #
index 54227ca636e02bb8fe468a812b5103c75af24320..cf9d7efa19263ff22665a7bb84f6ec3e3ead097a 100644 (file)
@@ -74,7 +74,7 @@ DAT_RETURN dapl_cno_free(
        goto bail;
     }
 
-    if (cno_ptr->cno_ref_count != 0
+    if (dapl_os_atomic_read(&cno_ptr->cno_ref_count) != 0
        || cno_ptr->cno_waiters != 0)
     {
        dat_status = DAT_ERROR (DAT_INVALID_STATE,DAT_INVALID_STATE_CNO_IN_USE);
index 1dfd5427d3424a307b1edbb92d66c79fc70e8d0b..97d0a72b98bd0c4544ab942890dc2607e5e5b1da 100644 (file)
@@ -83,7 +83,6 @@
 #include <asm/system.h>
 #endif
 
-
 /* Useful debug definitions */
 #ifndef STATIC
 #define STATIC static
@@ -156,11 +155,11 @@ dapl_os_atomic_inc (
 #ifdef __ia64__
     DAT_COUNT  old_value;
 
-#if OS_VERSION >= LINUX_VERSION(2,6)
-    IA64_FETCHADD  (old_value,v,1,4,rel);
-#else
-    IA64_FETCHADD  (old_value,v,1,4);
-#endif
+#   if !defined(REDHAT_EL4) && (OS_RELEASE >= LINUX_VERSION(2,6))
+       IA64_FETCHADD(old_value,v,1,4,rel);
+#   else
+       IA64_FETCHADD(old_value,v,1,4);
+#   endif
 
 #else  /* !__ia64__ */
     __asm__ __volatile__ (
@@ -184,11 +183,11 @@ dapl_os_atomic_dec (
 #ifdef __ia64__
     DAT_COUNT  old_value;
 
-#if OS_VERSION >= LINUX_VERSION(2,6)
-    IA64_FETCHADD  (old_value,v,-1,4,rel);
-#else
-    IA64_FETCHADD  (old_value,v,-1,4);
-#endif
+#   if !defined(REDHAT_EL4) && (OS_RELEASE >= LINUX_VERSION(2,6))
+       IA64_FETCHADD(old_value,v,-1,4,rel);
+#   else
+       IA64_FETCHADD(old_value,v,-1,4);
+#   endif
 
 #else  /* !__ia64__ */
     __asm__ __volatile__ (
@@ -227,9 +226,11 @@ dapl_os_atomic_assign (
      */
 
 #ifdef __ia64__
-
-current_value = ia64_cmpxchg("acq",v,match_value,new_value,4);
-
+#ifdef REDHAT_EL4
+    current_value = ia64_cmpxchg("acq",v,match_value,new_value,4);
+#else
+    current_value = ia64_cmpxchg(acq,v,match_value,new_value,4);
+#endif
 #else
     __asm__ __volatile__ (
         "lock; cmpxchgl %1, %2"