Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
DISCONTINUED:openSUSE:11.1:Update
db43
db-4.3.29.dif
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File db-4.3.29.dif of Package db43
--- dbinc/mutex.h +++ dbinc/mutex.h @@ -590,12 +590,11 @@ MUTEX_SET(int *tsl) { " cmpwi %0,0 \n\t" " bne- 1f \n\t" " stwcx. %2,0,%2 \n\t" -" isync \n\t" " beq+ 2f \n\t" " b 0b \n\t" "1: \n\t" " li %1, 0 \n\t" -"2: \n\t" +"2: isync \n\t" : "=&r" (__r), "=r" (tsl) : "r" (__tmp) : "cr0", "memory"); @@ -746,6 +745,40 @@ typedef int tsl_t; #endif /********************************************************************* + * MIPS/gcc assembly. + *********************************************************************/ +#ifdef HAVE_MUTEX_MIPS_GCC_ASSEMBLY +typedef unsigned int tsl_t; +#define MUTEX_ALIGN sizeof(unsigned int) + +#ifdef LOAD_ACTUAL_MUTEX_CODE +/* + * For gcc/MIPS; + */ +#define MUTEX_SET(tsl) ({ \ + tsl_t tmp, res; \ + register tsl_t *__l = (tsl); \ + __asm__ __volatile__( \ + ".set\tnoreorder\t\t# test_and_set_bit\n" \ + "1:\tll\t%0, %1\n\t" \ + "ori\t%2, %0, 1\n\t" \ + "sc\t%2, %1\n\t" \ + "beqz\t%2, 1b\n\t" \ + " andi\t%2, %0, 1\n\t" \ + "sync\n\t" \ + ".set\treorder" \ + : "=&r" (tmp), "=m" (*__l), "=&r" (res) \ + : "m" (*__l) \ + : "memory"); \ + (res ^ 1) & 1; \ +}) + +#define MUTEX_UNSET(tsl) (*(tsl) = 0) +#define MUTEX_INIT(tsl) MUTEX_UNSET(tsl) +#endif +#endif + +/********************************************************************* * x86/gcc assembly. *********************************************************************/ #ifdef HAVE_MUTEX_X86_GCC_ASSEMBLY @@ -780,6 +813,61 @@ typedef unsigned char tsl_t; #endif #endif +/********************************************************************* + * x86_64/gcc assembly. + *********************************************************************/ +#ifdef HAVE_MUTEX_X86_64_GCC_ASSEMBLY +typedef unsigned char tsl_t; + +#ifdef LOAD_ACTUAL_MUTEX_CODE +/* + * For gcc/x86-64, 0 is clear, 1 is set. + */ +#define MUTEX_SET(tsl) ({ \ + register tsl_t *__l = (tsl); \ + int __r; \ + asm volatile("movq $1,%%rax; lock; xchgb %1,%%al; xorq $1,%%rax"\ + : "=&a" (__r), "=m" (*__l) \ + : "1" (*__l) \ + ); \ + __r & 1; \ +}) + +#define MUTEX_UNSET(tsl) (*(tsl) = 0) +#define MUTEX_INIT(tsl) MUTEX_UNSET(tsl) +#endif +#endif + +/********************************************************************* + * alphalinux/gcc assembly. + *********************************************************************/ +#ifdef HAVE_MUTEX_ALPHA_LINUX_ASSEMBLY +typedef unsigned long int tsl_t; + +#define MUTEX_ALIGN 8 +#endif + +/********************************************************************* + * sparc32linux/gcc assembly. + *********************************************************************/ +#ifdef HAVE_MUTEX_SPARC32_LINUX_ASSEMBLY +typedef unsigned char tsl_t; +#endif + +/********************************************************************* + * sparc64linux/gcc assembly. + *********************************************************************/ +#ifdef HAVE_MUTEX_SPARC64_LINUX_ASSEMBLY +typedef unsigned char tsl_t; +#endif + +/********************************************************************* + * s390linux/gcc assembly. + *********************************************************************/ +#ifdef HAVE_MUTEX_S390_LINUX_ASSEMBLY +typedef volatile int tsl_t; +#endif + /* * Mutex alignment defaults to one byte. * --- dbm/dbm.c +++ dbm/dbm.c @@ -119,11 +119,10 @@ datum __db_dbm_fetch(key) datum key; { - datum item; + datum item = {NULL, 0}; if (__cur_db == NULL) { __db_no_open(); - item.dptr = 0; return (item); } return (dbm_fetch(__cur_db, key)); @@ -132,11 +131,10 @@ __db_dbm_fetch(key) datum __db_dbm_firstkey() { - datum item; + datum item = {NULL, 0}; if (__cur_db == NULL) { __db_no_open(); - item.dptr = 0; return (item); } return (dbm_firstkey(__cur_db)); @@ -146,13 +144,12 @@ datum __db_dbm_nextkey(key) datum key; { - datum item; + datum item = {NULL, 0}; COMPQUIET(key.dsize, 0); if (__cur_db == NULL) { __db_no_open(); - item.dptr = 0; return (item); } return (dbm_nextkey(__cur_db)); --- dist/Makefile.in +++ dist/Makefile.in @@ -144,8 +144,8 @@ libtso_major= $(libtso_base)-$(LIBMAJOR) # local libraries, for example. Do that by adding -I options to the DB185INC # line, and -l options to the DB185LIB line. ################################################## -DB185INC= -c @CFLAGS@ -I$(srcdir) @CPPFLAGS@ -DB185LIB= +DB185INC= -c @CFLAGS@ -I/usr/include/db1 @CPPFLAGS@ +DB185LIB= -ldb1 ################################################## # NOTHING BELOW THIS LINE SHOULD EVER NEED TO BE MODIFIED. --- dist/aclocal/libtool.ac +++ dist/aclocal/libtool.ac @@ -2683,8 +2683,8 @@ if test "$GXX" = yes; then # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' --- dist/aclocal/mutex.ac +++ dist/aclocal/mutex.ac @@ -207,7 +207,7 @@ fi if test "$db_cv_mutex" = no; then AC_TRY_LINK([ #include <sys/mman.h>],[ -#if defined(__hppa) +#if defined(__hppa__) typedef msemaphore tsl_t; msemaphore x; msem_init(&x, 0); @@ -353,6 +353,17 @@ AC_TRY_COMPILE(,[ ], [db_cv_mutex="ARM/gcc-assembly"]) fi +# MIPS/gcc: Linux +if test "$db_cv_mutex" = no; then +AC_TRY_COMPILE(,[ +#if (defined(__mips) || defined(__mips__)) && defined(__GNUC__) + exit(0); +#else + FAIL TO COMPILE/LINK +#endif +], [db_cv_mutex="MIPS/gcc-assembly"]) +fi + # PaRisc/gcc: HP/UX if test "$db_cv_mutex" = no; then AC_TRY_COMPILE(,[ @@ -430,6 +441,18 @@ AC_TRY_COMPILE(,[ ], [db_cv_mutex="S390/gcc-assembly"]) fi +# x86-64/gcc: FreeBSD, NetBSD, BSD/OS, Linux +if test "$db_cv_mutex" = no; then +AC_TRY_RUN([main(){ +#if defined(__x86_64__) +#if defined(__GNUC__) + exit(0); +#endif +#endif + exit(1); +}], [db_cv_mutex="x86_64/gcc-assembly"]) +fi + # ia86/gcc: Linux if test "$db_cv_mutex" = no; then AC_TRY_COMPILE(,[ @@ -441,6 +464,53 @@ AC_TRY_COMPILE(,[ ], [db_cv_mutex="ia64/gcc-assembly"]) fi +dnl alphalinux/gcc: Linux +if test "$db_cv_mutex" = no; then +AC_TRY_RUN([main(){ +#if defined(__alpha__) +#if defined(__linux__) + exit(0); +#endif +#endif + exit(1); +}], [db_cv_mutex="alphalinux/gcc-assembly"]) +fi + +dnl sparc32linux/gcc: Linux +if test "$db_cv_mutex" = no; then +AC_TRY_RUN([main(){ +#if defined(__sparc__) && !defined(__arch64__) +#if defined(__linux__) + exit(0); +#endif +#endif + exit(1); +}], [db_cv_mutex="sparc32linux/gcc-assembly"]) +fi + +dnl sparc64linux/gcc: Linux +if test "$db_cv_mutex" = no; then +AC_TRY_RUN([main(){ +#if defined(__sparc__) && defined(__arch64__) +#if defined(__linux__) + exit(0); +#endif +#endif + exit(1); +}], [db_cv_mutex="sparc64linux/gcc-assembly"]) +fi + +dnl s390linux/gcc: Linux +if test "$db_cv_mutex" = no; then +AC_TRY_RUN([main(){ +#if defined(__linux__) && defined(__s390__) + exit(0); +#endif + exit(1); +}], [db_cv_mutex="s390linux/gcc-assembly"]) +fi + + # uts/cc: UTS if test "$db_cv_mutex" = no; then AC_TRY_COMPILE(,[ @@ -594,6 +664,31 @@ x86/gcc-assembly) ADDITIONAL_OBJS="mut_t AC_DEFINE(HAVE_MUTEX_X86_GCC_ASSEMBLY) AH_TEMPLATE(HAVE_MUTEX_X86_GCC_ASSEMBLY, [Define to 1 to use the GCC compiler and x86 assembly language mutexes.]);; +MIPS/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_MIPS_GCC_ASSEMBLY) + AH_TEMPLATE(HAVE_MUTEX_MIPS_GCC_ASSEMBLY, + [Define to 1 to use the GCC compiler and Mips assembly language mutexes.]);; +x86_64/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_X86_64_GCC_ASSEMBLY) + AH_TEMPLATE(HAVE_MUTEX_X86_64_GCC_ASSEMBLY, + [Define to use the GCC compiler and x86-64 assembly language mutexes.]);; +alphalinux/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_ALPHA_LINUX_ASSEMBLY) + AH_TEMPLATE(HAVE_MUTEX_ALPHA_LINUX_ASSEMBLY, + [Define to use the GCC compiler and alpha assembly language mutexes.]);; +sparc32linux/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_SPARC32_LINUX_ASSEMBLY) + AH_TEMPLATE(HAVE_MUTEX_SPARC32_LINUX_ASSEMBLY, + [Define to use the GCC compiler and sparc64 assembly language mutexes.]);; +sparc64linux/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_SPARC64_LINUX_ASSEMBLY) + AH_TEMPLATE(HAVE_MUTEX_SPARC64_LINUX_ASSEMBLY, + [Define to use the GCC compiler and sparc64 assembly language mutexes.]);; +s390linux/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS" + AC_DEFINE(HAVE_MUTEX_S390_LINUX_ASSEMBLY) + AH_TEMPLATE(HAVE_MUTEX_S390_LINUX_ASSEMBLY, + [Define to use the GCC compiler and s390 assembly lan +guage mutexes.]);; UNIX/fcntl) AC_MSG_WARN( [NO FAST MUTEXES FOUND FOR THIS COMPILER/ARCHITECTURE.]) ADDITIONAL_OBJS="mut_fcntl${o} $ADDITIONAL_OBJS" --- dist/configure.ac +++ dist/configure.ac @@ -690,14 +690,14 @@ LTLIBOBJS=`echo "$LIB@&t@OBJS" | AC_SUBST(LTLIBOBJS) # Initial output file list. -CREATE_LIST="Makefile - db_cxx.h:$srcdir/../dbinc/db_cxx.in - db_int.h:$srcdir/../dbinc/db_int.in +CREATE_LIST="Makefile \ + db_cxx.h:$srcdir/../dbinc/db_cxx.in \ + db_int.h:$srcdir/../dbinc/db_int.in \ include.tcl:$srcdir/../test/include.tcl" # MinGW needs win_db.h. if test "$db_cv_mingw" = "yes"; then -CREATE_LIST="$CREATE_LIST +CREATE_LIST="$CREATE_LIST \ win_db.h:$srcdir/win_db.in" fi @@ -705,10 +705,10 @@ fi # prototypes, and, if configured for unique names, a list of #defines # to do DB_VERSION_UNIQUE_NAME substitution. if test "$db_cv_uniquename" = "yes"; then - CREATE_LIST="$CREATE_LIST + CREATE_LIST="$CREATE_LIST \ db.h:$srcdir/../dbinc/db.in:$srcdir/../dbinc_auto/ext_def.in:$srcdir/../dbinc_auto/ext_prot.in" else - CREATE_LIST="$CREATE_LIST + CREATE_LIST="$CREATE_LIST \ db.h:$srcdir/../dbinc/db.in:$srcdir/../dbinc_auto/ext_prot.in" fi @@ -716,7 +716,7 @@ fi # does the DB_VERSION_UNIQUE_NAME substitution), which is included by # the db_int.h file. if test "$db_cv_uniquename" = "yes"; then - CREATE_LIST="$CREATE_LIST + CREATE_LIST="$CREATE_LIST \ db_int_def.h:$srcdir/../dbinc_auto/int_def.in" db_int_def='#include "db_int_def.h"' fi @@ -726,12 +726,12 @@ fi # of #defines to do DB_VERSION_UNIQUE_NAME substitution. if test "$db_cv_compat185" = "yes"; then if test "$db_cv_uniquename" = "yes"; then - CREATE_LIST="$CREATE_LIST - db_185.h:$srcdir/../dbinc/db_185.in:$srcdir/../dbinc_auto/ext_185_def.in:$srcdir/../dbinc_auto/ext_185_prot.in + CREATE_LIST="$CREATE_LIST \ + db_185.h:$srcdir/../dbinc/db_185.in:$srcdir/../dbinc_auto/ext_185_def.in:$srcdir/../dbinc_auto/ext_185_prot.in \ db185_int.h:$srcdir/../db185/db185_int.in:$srcdir/../dbinc_auto/ext_185_def.in:$srcdir/../dbinc_auto/ext_185_prot.in" else - CREATE_LIST="$CREATE_LIST - db_185.h:$srcdir/../dbinc/db_185.in:$srcdir/../dbinc_auto/ext_185_prot.in + CREATE_LIST="$CREATE_LIST \ + db_185.h:$srcdir/../dbinc/db_185.in:$srcdir/../dbinc_auto/ext_185_prot.in \ db185_int.h:$srcdir/../db185/db185_int.in:$srcdir/../dbinc_auto/ext_185_prot.in" fi fi --- mutex/mut_tas.c +++ mutex/mut_tas.c @@ -15,6 +15,18 @@ #include <stdlib.h> #include <string.h> #endif +#ifdef HAVE_MUTEX_ALPHA_LINUX_ASSEMBLY +#include "alphalinux.gcc" +#endif +#ifdef HAVE_MUTEX_SPARC32_LINUX_ASSEMBLY +#include "sparc32linux.gcc" +#endif +#ifdef HAVE_MUTEX_SPARC64_LINUX_ASSEMBLY +#include "sparc64linux.gcc" +#endif +#ifdef HAVE_MUTEX_S390_LINUX_ASSEMBLY +#include "s390linux.gcc" +#endif /* * This is where we load in the actual test-and-set mutex code.
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor