Index: db2/db_int.h =================================================================== RCS file: /glibc/cvsfiles/libc/db2/db_int.h,v retrieving revision 1.10 diff -u -r1.10 db_int.h --- glibc-2.1.2/db2/db_int.h 1999/06/16 14:27:59 1.10 +++ glibc-2.1.2/db2/db_int.h 1999/08/30 21:26:15 @@ -138,7 +138,7 @@ /******************************************************* * Mutex support. *******************************************************/ -typedef unsigned char tsl_t; +typedef u_int32_t tsl_t; /* * !!! Index: db2/mutex/mutex.c =================================================================== RCS file: /glibc/cvsfiles/libc/db2/mutex/mutex.c,v retrieving revision 1.7 diff -u -r1.7 mutex.c --- glibc-2.1.2/db2/mutex/mutex.c 1999/06/13 11:24:41 1.7 +++ glibc-2.1.2/db2/mutex/mutex.c 1999/08/30 21:26:16 @@ -110,6 +110,10 @@ #include "x86.gcc" #endif +#ifdef HAVE_ASSEM_ALPHA +#include "alpha.h" +#endif + #ifdef WIN16 /* Win16 spinlocks are simple because we cannot possibly be preempted. */ #define TSL_INIT(tsl) Index: db2/mutex/alpha.h =================================================================== --- /dev/null Tue May 5 13:32:27 1998 +++ glibc-2.1.2/db2/mutex/alpha.h Mon Aug 30 14:21:09 1999 @@ -0,0 +1,26 @@ +/* For alpha, 0 is clear, 1 is set. */ + +#ifdef __GNUC__ +#define TSL_SET(tsl) ({ \ + register tsl_t *__l = (tsl); \ + int __r; \ + asm volatile( \ + "1: ldl_l %0,%1\n" \ + " blbs %0,2f\n" \ + " mov 1,%0\n" \ + " stl_c %0,%1\n" \ + " bne %0,1b\n" \ + " mb\n" \ + "2:" \ + : "=&r"(__r), "=m"(*__l) : "m"(*__l) : "memory"); \ + __r; \ +}) +#endif + +#ifdef __DECC +#include +#define TSL_SET(tsl) (__LOCK_LONG_RETRY((tsl), 1) != 0) +#endif + +#define TSL_UNSET(tsl) (*(tsl) = 0) +#define TSL_INIT(tsl) TSL_UNSET(tsl) Index: sysdeps/alpha/Makefile =================================================================== RCS file: /glibc/cvsfiles/libc/sysdeps/alpha/Makefile,v retrieving revision 1.15 diff -u -r1.15 Makefile --- glibc-2.1.2/sysdeps/alpha/Makefile 1998/06/27 09:50:41 1.15 +++ glibc-2.1.2/sysdeps/alpha/Makefile 1999/08/30 21:34:00 @@ -1,4 +1,4 @@ -# Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. +# Copyright (C) 1993, 94, 95, 96, 97, 99 Free Software Foundation, Inc. # This file is part of the GNU C Library. # Contributed by Brendan Kehoe (brendan@zen.org). @@ -16,6 +16,10 @@ # License along with the GNU C Library; see the file COPYING.LIB. If not, # write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. + +ifeq ($(subdir),db2) +CPPFLAGS += -DHAVE_SPINLOCKS=1 -DHAVE_ASSEM_ALPHA=1 +endif ifeq ($(subdir),gmon) sysdep_routines += _mcount