--- include/mutex.h     2002/08/31 05:16:36     1.1
+++ include/mutex.h     2002/08/31 05:17:26
@@ -501,6 +501,23 @@
 })
 
 #define        MUTEX_UNSET(tsl)        (*(tsl) = 0)
+#define        MUTEX_INIT(tsl)         MUTEX_UNSET(tsl)
+#endif
+#endif
+
+/* OS/390 C
+ * cs() is declared in <stdlib.h> but is built in to the compiler.
+ * Must use LANGLVL(EXTENDED) to get its declaration.
+ */
+#ifdef HAVE_MUTEX_S390_CC_ASSEMBLY
+typedef int tsl_t;
+
+#define        MUTEX_ALIGN      sizeof(int)
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+#define MUTEX_SET(tsl) (!cs(&zero, (tsl), 1))
+
+#define MUTEX_UNSET(tsl)       (*(tsl) = 0)
 #define        MUTEX_INIT(tsl)         MUTEX_UNSET(tsl)
 #endif
 #endif
--- dist/aclocal/mutex.ac       2002/08/31 05:18:49     1.1
+++ dist/aclocal/mutex.ac       2002/08/31 05:22:05
@@ -316,6 +316,17 @@
 }], [db_cv_mutex="x86/gcc-assembly"])
 fi
 
+# S390/cc: IBM OS/390 Unix
+if test "$db_cv_mutex" = no; then
+AC_TRY_COMPILE(,[
+#if defined(__MVS__) && defined(__IBMC__)
+       exit(0);
+#else
+       FAIL TO COMPILE/LINK
+#endif
+], [db_cv_mutex="S390/cc-assembly"])
+fi
+
 # ia86/gcc: Linux
 if test "$db_cv_mutex" = no; then
 AC_TRY_RUN([main(){
@@ -391,6 +402,10 @@
                        AC_DEFINE(HAVE_MUTEX_RELIANTUNIX_INITSPIN)
                        AH_TEMPLATE(HAVE_MUTEX_RELIANTUNIX_INITSPIN, [
                            Define to use Reliant UNIX initspin mutexes.]);;
+S390/cc-assembly)      ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+                       AC_DEFINE(HAVE_MUTEX_S390_CC_ASSEMBLY)
+                       AH_TEMPLATE(HAVE_MUTEX_S390_CC_ASSEMBLY,
+                           [Define to use the IBM C compiler and S/390 assembly language mutexes.]);;
 SCO/x86/cc-assembly)   ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
                        AC_DEFINE(HAVE_MUTEX_SCO_X86_CC_ASSEMBLY)
                        AH_TEMPLATE(HAVE_MUTEX_SCO_X86_CC_ASSEMBLY, [
--- mutex/mut_tas.c     2002/08/31 05:23:47     1.1
+++ mutex/mut_tas.c     2002/08/31 05:24:17
@@ -106,6 +106,9 @@
 #ifdef HAVE_MUTEX_HPPA_MSEM_INIT
 relock:
 #endif
+#ifdef HAVE_MUTEX_S390_CC_ASSEMBLY
+               tsl_t zero = 0;
+#endif
                if (!MUTEX_SET(&mutexp->tas))
                        continue;
 #ifdef HAVE_MUTEX_HPPA_MSEM_INIT
 
hyc@openldap.org |