1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
diff -ur gc/gcconfig.h w3m/gc/gcconfig.h
--- gc/gcconfig.h Tue Jan 4 14:46:50 2000
+++ gc/gcconfig.h Fri May 26 00:30:56 2000
@@ -67,11 +67,13 @@
# if defined(ultrix) || defined(__ultrix) || defined(__NetBSD__)
# define ULTRIX
# else
-# if defined(_SYSTYPE_SVR4) || defined(SYSTYPE_SVR4) || defined(__SYSTYPE_SVR4__)
-# define IRIX5 /* or IRIX 6.X */
-# else
-# define RISCOS /* or IRIX 4.X */
-# endif
+# if !defined(LINUX)
+# if defined(_SYSTYPE_SVR4) || defined(SYSTYPE_SVR4) || defined(__SYSTYPE_SVR4__)
+# define IRIX5 /* or IRIX 6.X */
+# else
+# define RISCOS /* or IRIX 4.X */
+# endif
+# endif
# endif
# define mach_type_known
# endif
@@ -836,49 +838,58 @@
# ifdef MIPS
# define MACH_TYPE "MIPS"
-# ifndef IRIX5
-# define DATASTART (ptr_t)0x10000000
+# ifdef LINUX
+# define OS_TYPE "LINUX"
+ extern int __data_start;
+# define DATASTART ((ptr_t)(&__data_start))
+# define ALIGNMENT 4
+# define USE_GENERIC_PUSH_REGS 1
+# define STACKBOTTOM 0x80000000
+# else /* LINUX */
+# ifndef IRIX5
+# define DATASTART (ptr_t)0x10000000
/* Could probably be slightly higher since */
/* startup code allocates lots of stuff. */
-# else
- extern int _fdata;
-# define DATASTART ((ptr_t)(&_fdata))
-# ifdef USE_MMAP
-# define HEAP_START (ptr_t)0x30000000
# else
-# define HEAP_START DATASTART
-# endif
+ extern int _fdata;
+# define DATASTART ((ptr_t)(&_fdata))
+# ifdef USE_MMAP
+# define HEAP_START (ptr_t)0x30000000
+# else
+# define HEAP_START DATASTART
+# endif
/* Lowest plausible heap address. */
/* In the MMAP case, we map there. */
/* In either case it is used to identify */
/* heap sections so they're not */
/* considered as roots. */
-# endif /* IRIX5 */
-# define HEURISTIC2
+# endif /* IRIX5 */
+# define HEURISTIC2
/* # define STACKBOTTOM ((ptr_t)0x7fff8000) sometimes also works. */
-# ifdef ULTRIX
-# define OS_TYPE "ULTRIX"
-# define ALIGNMENT 4
-# endif
-# ifdef RISCOS
-# define OS_TYPE "RISCOS"
-# define ALIGNMENT 4 /* Required by hardware */
-# endif
-# ifdef IRIX5
-# define OS_TYPE "IRIX5"
-# define MPROTECT_VDB
-# ifdef _MIPS_SZPTR
-# define CPP_WORDSZ _MIPS_SZPTR
-# define ALIGNMENT (_MIPS_SZPTR/8)
-# if CPP_WORDSZ != 64
+# ifdef ULTRIX
+# define OS_TYPE "ULTRIX"
+# define ALIGNMENT 4
+# endif
+# ifdef RISCOS
+# define OS_TYPE "RISCOS"
+# define ALIGNMENT 4 /* Required by hardware */
+# endif
+# ifdef IRIX5
+# define OS_TYPE "IRIX5"
+# define MPROTECT_VDB
+# ifdef _MIPS_SZPTR
+# define CPP_WORDSZ _MIPS_SZPTR
+# define ALIGNMENT (_MIPS_SZPTR/8)
+# if CPP_WORDSZ != 64
+# define ALIGN_DOUBLE
+# endif
+# else
+# define ALIGNMENT 4
# define ALIGN_DOUBLE
# endif
-# else
-# define ALIGNMENT 4
-# define ALIGN_DOUBLE
-# endif
-# define DYNAMIC_LOADING
-# endif
+# define DYNAMIC_LOADING
+# endif
+# endif
# endif
# ifdef RS6000
diff -ur gc/mach_dep.c w3m/gc/mach_dep.c
--- gc/mach_dep.c Tue Jan 4 14:46:50 2000
+++ gc/mach_dep.c Fri May 26 00:34:11 2000
@@ -74,6 +74,21 @@
# ifdef RT
register long TMP_SP; /* must be bound to r11 */
# endif
+# if defined(MIPS) && defined(LINUX)
+# define call_push(x) asm("move $4," x ";"); asm("jal GC_push_one")
+ call_push("$2");
+ call_push("$3");
+ call_push("$16");
+ call_push("$17");
+ call_push("$18");
+ call_push("$19");
+ call_push("$20");
+ call_push("$21");
+ call_push("$22");
+ call_push("$23");
+ call_push("$30");
+# undef call_push
+# endif /* MIPS && LINUX */
# ifdef VAX
/* VAX - generic code below does not work under 4.2 */
/* r1 through r5 are caller save, and therefore */
@@ -338,7 +353,9 @@
# if !(defined M68K) && !(defined VAX) && !(defined RT)
# if !(defined SPARC) && !(defined I386) && !(defined NS32K)
# if !defined(POWERPC) && !defined(UTS4)
+# if (!defined(MIPS) && !defined(LINUX))
--> bad news <--
+# endif
# endif
# endif
# endif
diff -ur gc/misc.c w3m/gc/misc.c
--- gc/misc.c Tue Jan 4 14:46:50 2000
+++ gc/misc.c Fri May 26 00:52:59 2000
@@ -433,7 +433,8 @@
# ifdef MSWIN32
GC_init_win32();
# endif
-# if defined(LINUX) && (defined(POWERPC) || defined(ALPHA) || defined(SPARC))
+# if defined(LINUX) && (defined(POWERPC) || defined(ALPHA) || \
+ defined(SPARC) || defined(MIPS))
GC_init_linux_data_start();
# endif
# ifdef SOLARIS_THREADS
diff -ur gc/os_dep.c w3m/gc/os_dep.c
--- gc/os_dep.c Tue Jan 4 14:46:50 2000
+++ gc/os_dep.c Fri May 26 00:37:07 2000
@@ -72,7 +72,8 @@
# define NEED_FIND_LIMIT
# endif
-# if defined(LINUX) && (defined(POWERPC) || defined(SPARC) || defined(ALPHA))
+# if defined(LINUX) && (defined(POWERPC) || defined(SPARC) || \
+ defined(ALPHA) || defined(MIPS))
# define NEED_FIND_LIMIT
# endif
@@ -139,7 +140,8 @@
# define OPT_PROT_EXEC 0
#endif
-#if defined(LINUX) && (defined(POWERPC) || defined(SPARC) || defined(ALPHA))
+#if defined(LINUX) && (defined(POWERPC) || defined(SPARC) || \
+ defined(ALPHA) || defined(MIPS))
/* The I386 case can be handled without a search. The Alpha case */
/* used to be handled differently as well, but the rules changed */
/* for recent Linux versions. This seems to be the easiest way to */
|