yann@1
|
1 |
2000-03-15 Cristian Gafton <gafton@redhat.com>
|
yann@1
|
2 |
|
yann@1
|
3 |
* db2/mutex/alpha.gcc (TSL_SET): Backport from db3.
|
yann@1
|
4 |
* sysdeps/alpha/Makefile (CPPFLAGS): Define for db2 directory.
|
yann@1
|
5 |
* db2/mutex/mutex.c: Include alpha.gcc ifdef HAVE_ASSEM_ALPHA_GCC.
|
yann@1
|
6 |
|
yann@1
|
7 |
2000-03-14 Ulrich Drepper <drepper@redhat.com>
|
yann@1
|
8 |
|
yann@1
|
9 |
* sysdeps/unix/sysv/linux/alpha/ioperm.c (platform): Add entry for
|
yann@1
|
10 |
Nautilus. Patch by Soohoon Lee <soohoon.lee@alpha-processor.com>.
|
yann@1
|
11 |
|
yann@1
|
12 |
--- glibc-2.1.3-15/db2/mutex/alpha.gcc Wed Aug 27 15:32:54 1997
|
yann@1
|
13 |
+++ glibc-2.1.3-16/db2/mutex/alpha.gcc Wed Mar 15 16:50:45 2000
|
yann@1
|
14 |
@@ -1,52 +1,24 @@
|
yann@1
|
15 |
/*
|
yann@1
|
16 |
- * @(#)alpha.gcc 10.1 (Sleepycat) 4/12/97
|
yann@1
|
17 |
- *
|
yann@1
|
18 |
- * The code appearing below is taken from Richard L. Sites, ed. "Alpha
|
yann@1
|
19 |
- * Architecture Reference Manual", Digital Press, 1992, page 5-7 and 5-8.
|
yann@1
|
20 |
- * There are 2 modifications:
|
yann@1
|
21 |
- *
|
yann@1
|
22 |
- * 1. The jump from blbs __r1,30f to !__r1, which is dictated by the way the
|
yann@1
|
23 |
- * TSL_SET macro is used. The code suggested in Sites includes the main loop
|
yann@1
|
24 |
- * of the spin lock, whereas in this code the rest the loop is specified in C.
|
yann@1
|
25 |
- * The generated code might be suboptimal if the compiler generates a forward
|
yann@1
|
26 |
- * branch for the usual case in which the mutex is uncontested.
|
yann@1
|
27 |
- *
|
yann@1
|
28 |
- * 2. At label 20, Sites suggests including code for testing for an excessive
|
yann@1
|
29 |
- * number of _processor_ lock conflicts. (The seq_c instruction stores its
|
yann@1
|
30 |
- * first argument provided that no other processor has written to a byte range
|
yann@1
|
31 |
- * including its memory-location argument.) Absent such checking the code
|
yann@1
|
32 |
- * below could conceivably stall silently on a multiprocessor alpha, depending
|
yann@1
|
33 |
- * on how often processor/processor conflicts occur in a particular byte range.
|
yann@1
|
34 |
- *
|
yann@1
|
35 |
- * Note that the mb ("memory-barrier") instruction in TSL_UNSET is critical to
|
yann@1
|
36 |
- * correct operation in a multiprocessor alpha (as is, of course, the mb in
|
yann@1
|
37 |
- * the TSL_SET macro). Without the mb, changes to shared memory that occurred
|
yann@1
|
38 |
- * inside the critical section (before the TSL_UNSET) might reach shared memory
|
yann@1
|
39 |
- * _after_ the change of tsl to 0, thereby permitting another processor to see
|
yann@1
|
40 |
- * an inconsistent view of the data protected by the mutex.
|
yann@1
|
41 |
+ * @(#)alpha.gcc 11.1 (Sleepycat) 8/30/99
|
yann@1
|
42 |
*
|
yann@1
|
43 |
* For gcc/alpha, 0 is clear, 1 is set.
|
yann@1
|
44 |
*/
|
yann@1
|
45 |
-#define TSL_SET(tsl) ({ \
|
yann@1
|
46 |
+#ifdef __GNUC__
|
yann@1
|
47 |
+#define TSL_SET(tsl) ({ \
|
yann@1
|
48 |
register tsl_t *__l = (tsl); \
|
yann@1
|
49 |
- register tsl_t __r1, __r2; \
|
yann@1
|
50 |
- __asm__ volatile(" \n\
|
yann@1
|
51 |
- 10: ldq_l %0,(%2) \n\
|
yann@1
|
52 |
- blbs %0,30f \n\
|
yann@1
|
53 |
- or %0,1,%1 \n\
|
yann@1
|
54 |
- stq_c %1,(%2) \n\
|
yann@1
|
55 |
- beq %1,20f \n\
|
yann@1
|
56 |
- mb \n\
|
yann@1
|
57 |
- br 30f \n\
|
yann@1
|
58 |
- 20: br 10b \n\
|
yann@1
|
59 |
- 30: " \
|
yann@1
|
60 |
- : "=&r" (__r1), "=&r" (__r2) \
|
yann@1
|
61 |
- : "r" (__l)); \
|
yann@1
|
62 |
- !__r1; \
|
yann@1
|
63 |
+ int __r; \
|
yann@1
|
64 |
+ asm volatile( \
|
yann@1
|
65 |
+ "1: ldl_l %0,%1\n" \
|
yann@1
|
66 |
+ " blbs %0,2f\n" \
|
yann@1
|
67 |
+ " mov 1,%0\n" \
|
yann@1
|
68 |
+ " stl_c %0,%1\n" \
|
yann@1
|
69 |
+ " bne %0,1b\n" \
|
yann@1
|
70 |
+ " mb\n" \
|
yann@1
|
71 |
+ "2:" \
|
yann@1
|
72 |
+ : "=&r"(__r), "=m"(*__l) : "m"(*__l) : "memory"); \
|
yann@1
|
73 |
+ __r; \
|
yann@1
|
74 |
})
|
yann@1
|
75 |
+#endif
|
yann@1
|
76 |
|
yann@1
|
77 |
-#define TSL_UNSET(tsl) ({ \
|
yann@1
|
78 |
- register tsl_t *__l = (tsl); \
|
yann@1
|
79 |
- __asm__ volatile("mb; stq $31,(%0);" : : "r" (__l)); \
|
yann@1
|
80 |
-})
|
yann@1
|
81 |
+#define TSL_UNSET(tsl) (*(tsl) = 0)
|
yann@1
|
82 |
#define TSL_INIT(tsl) TSL_UNSET(tsl)
|
yann@1
|
83 |
--- glibc-2.1.3-15/db2/mutex/mutex.c Wed Jun 30 11:51:07 1999
|
yann@1
|
84 |
+++ glibc-2.1.3-16/db2/mutex/mutex.c Wed Mar 15 16:50:45 2000
|
yann@1
|
85 |
@@ -86,6 +86,10 @@ static const char sccsid[] = "@(#)mutex.
|
yann@1
|
86 |
#include "sparc.gcc"
|
yann@1
|
87 |
#endif
|
yann@1
|
88 |
|
yann@1
|
89 |
+#ifdef HAVE_ASSEM_ALPHA_GCC
|
yann@1
|
90 |
+#include "alpha.gcc"
|
yann@1
|
91 |
+#endif
|
yann@1
|
92 |
+
|
yann@1
|
93 |
#ifdef HAVE_ASSEM_UTS4_CC
|
yann@1
|
94 |
#define TSL_INIT(x)
|
yann@1
|
95 |
#define TSL_SET(x) (!uts_lock(x, 1))
|
yann@1
|
96 |
--- glibc-2.1.3-15/sysdeps/alpha/Makefile Thu Jul 9 14:52:03 1998
|
yann@1
|
97 |
+++ glibc-2.1.3-16/sysdeps/alpha/Makefile Wed Mar 15 16:50:45 2000
|
yann@1
|
98 |
@@ -17,6 +17,10 @@
|
yann@1
|
99 |
# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
yann@1
|
100 |
# Boston, MA 02111-1307, USA.
|
yann@1
|
101 |
|
yann@1
|
102 |
+ifeq ($(subdir),db2)
|
yann@1
|
103 |
+CPPFLAGS += -DHAVE_SPINLOCKS=1 -DHAVE_ASSEM_ALPHA_GCC=1
|
yann@1
|
104 |
+endif
|
yann@1
|
105 |
+
|
yann@1
|
106 |
ifeq ($(subdir),gmon)
|
yann@1
|
107 |
sysdep_routines += _mcount
|
yann@1
|
108 |
endif
|
yann@1
|
109 |
--- glibc-2.1.3-15/sysdeps/unix/sysv/linux/alpha/ioperm.c Mon Oct 11 10:25:24 1999
|
yann@1
|
110 |
+++ glibc-2.1.3-16/sysdeps/unix/sysv/linux/alpha/ioperm.c Wed Mar 15 11:57:14 2000
|
yann@1
|
111 |
@@ -1,4 +1,4 @@
|
yann@1
|
112 |
-/* Copyright (C) 1992, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
|
yann@1
|
113 |
+/* Copyright (C) 1992, 1996-1999, 2000 Free Software Foundation, Inc.
|
yann@1
|
114 |
This file is part of the GNU C Library.
|
yann@1
|
115 |
Contributed by David Mosberger.
|
yann@1
|
116 |
|
yann@1
|
117 |
@@ -139,6 +139,7 @@ static struct platform {
|
yann@1
|
118 |
{"Sable", IOSYS_CPUDEP},
|
yann@1
|
119 |
{"Miata", IOSYS_CIA},
|
yann@1
|
120 |
{"Tsunami", IOSYS_TSUNAMI},
|
yann@1
|
121 |
+ {"Nautilus", IOSYS_TSUNAMI},
|
yann@1
|
122 |
{"Rawhide", IOSYS_MCPCIA},
|
yann@1
|
123 |
{"Ruffian", IOSYS_CIA},
|
yann@1
|
124 |
{"Takara", IOSYS_CIA},
|