~ubuntu-branches/ubuntu/intrepid/ecl/intrepid

« back to all changes in this revision

Viewing changes to src/gc/darwin_stop_world.c

  • Committer: Bazaar Package Importer
  • Author(s): Albin Tonnerre
  • Date: 2008-06-20 18:00:19 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080620180019-7fbz1ln5444vtkkr
Tags: 0.9j-20080306-2ubuntu1
* Enabled unicode support. (Closes: LP #123530)
* Modify Maintainer value to match the DebianMaintainerField specification.

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
        if(r != KERN_SUCCESS) ABORT("thread_get_state failed");
103
103
        
104
104
#if defined(I386)
 
105
# if __DARWIN_UNIX03
 
106
        /* In Leopard, the registers get a prefix */
 
107
        lo = state.__esp;
 
108
 
 
109
        GC_push_one(state.__eax); 
 
110
        GC_push_one(state.__ebx); 
 
111
        GC_push_one(state.__ecx); 
 
112
        GC_push_one(state.__edx); 
 
113
        GC_push_one(state.__edi); 
 
114
        GC_push_one(state.__esi); 
 
115
        GC_push_one(state.__ebp); 
 
116
# else
105
117
        lo = state.esp;
106
118
 
107
119
        GC_push_one(state.eax); 
111
123
        GC_push_one(state.edi); 
112
124
        GC_push_one(state.esi); 
113
125
        GC_push_one(state.ebp); 
 
126
# endif
114
127
#elif defined(POWERPC)
 
128
# if __DARWIN_UNIX03
 
129
        /* In Leopard, the registers get a prefix */
 
130
        lo = (void*)(state.__r1 - PPC_RED_ZONE_SIZE);
 
131
        
 
132
        GC_push_one(state.__r0); 
 
133
        GC_push_one(state.__r2); 
 
134
        GC_push_one(state.__r3); 
 
135
        GC_push_one(state.__r4); 
 
136
        GC_push_one(state.__r5); 
 
137
        GC_push_one(state.__r6); 
 
138
        GC_push_one(state.__r7); 
 
139
        GC_push_one(state.__r8); 
 
140
        GC_push_one(state.__r9); 
 
141
        GC_push_one(state.__r10); 
 
142
        GC_push_one(state.__r11); 
 
143
        GC_push_one(state.__r12); 
 
144
        GC_push_one(state.__r13); 
 
145
        GC_push_one(state.__r14); 
 
146
        GC_push_one(state.__r15); 
 
147
        GC_push_one(state.__r16); 
 
148
        GC_push_one(state.__r17); 
 
149
        GC_push_one(state.__r18); 
 
150
        GC_push_one(state.__r19); 
 
151
        GC_push_one(state.__r20); 
 
152
        GC_push_one(state.__r21); 
 
153
        GC_push_one(state.__r22); 
 
154
        GC_push_one(state.__r23); 
 
155
        GC_push_one(state.__r24); 
 
156
        GC_push_one(state.__r25); 
 
157
        GC_push_one(state.__r26); 
 
158
        GC_push_one(state.__r27); 
 
159
        GC_push_one(state.__r28); 
 
160
        GC_push_one(state.__r29); 
 
161
        GC_push_one(state.__r30); 
 
162
        GC_push_one(state.__r31);
 
163
# else
115
164
        lo = (void*)(state.r1 - PPC_RED_ZONE_SIZE);
116
165
        
117
166
        GC_push_one(state.r0); 
145
194
        GC_push_one(state.r29); 
146
195
        GC_push_one(state.r30); 
147
196
        GC_push_one(state.r31);
 
197
#endif /* __DARWIN_UNIX03 */
148
198
#else
149
199
# error FIXME for non-x86 || ppc architectures
150
200
#endif
199
249
                             (natural_t *)&info, &outCount);
200
250
        if(r != KERN_SUCCESS) ABORT("task_get_state failed");
201
251
 
 
252
#      if __DARWIN_UNIX03
 
253
        /* In Leopard, the registers get a prefix */
 
254
        lo = (void*)(info.__r1 - PPC_RED_ZONE_SIZE);
 
255
        hi = (ptr_t)FindTopOfStack(info.__r1);
 
256
 
 
257
        GC_push_one(info.__r0); 
 
258
        GC_push_one(info.__r2); 
 
259
        GC_push_one(info.__r3); 
 
260
        GC_push_one(info.__r4); 
 
261
        GC_push_one(info.__r5); 
 
262
        GC_push_one(info.__r6); 
 
263
        GC_push_one(info.__r7); 
 
264
        GC_push_one(info.__r8); 
 
265
        GC_push_one(info.__r9); 
 
266
        GC_push_one(info.__r10); 
 
267
        GC_push_one(info.__r11); 
 
268
        GC_push_one(info.__r12); 
 
269
        GC_push_one(info.__r13); 
 
270
        GC_push_one(info.__r14); 
 
271
        GC_push_one(info.__r15); 
 
272
        GC_push_one(info.__r16); 
 
273
        GC_push_one(info.__r17); 
 
274
        GC_push_one(info.__r18); 
 
275
        GC_push_one(info.__r19); 
 
276
        GC_push_one(info.__r20); 
 
277
        GC_push_one(info.__r21); 
 
278
        GC_push_one(info.__r22); 
 
279
        GC_push_one(info.__r23); 
 
280
        GC_push_one(info.__r24); 
 
281
        GC_push_one(info.__r25); 
 
282
        GC_push_one(info.__r26); 
 
283
        GC_push_one(info.__r27); 
 
284
        GC_push_one(info.__r28); 
 
285
        GC_push_one(info.__r29); 
 
286
        GC_push_one(info.__r30); 
 
287
        GC_push_one(info.__r31);
 
288
#      else
202
289
        lo = (void*)(info.r1 - PPC_RED_ZONE_SIZE);
203
290
        hi = (ptr_t)FindTopOfStack(info.r1);
204
291
 
233
320
        GC_push_one(info.r29); 
234
321
        GC_push_one(info.r30); 
235
322
        GC_push_one(info.r31);
 
323
#      endif /* __DARWIN_UNIX03 */
 
324
 
236
325
#      else
237
326
        /* FIXME: Remove after testing: */
238
327
        WARN("This is completely untested and likely will not work\n", 0);
245
334
        lo = (void*)info.esp;
246
335
        hi = (ptr_t)FindTopOfStack(info.esp);
247
336
 
 
337
#      if __DARWIN_UNIX03
 
338
        /* In Leopard, the registers get a prefix */
 
339
        GC_push_one(info.__eax); 
 
340
        GC_push_one(info.__ebx); 
 
341
        GC_push_one(info.__ecx); 
 
342
        GC_push_one(info.__edx); 
 
343
        GC_push_one(info.__edi); 
 
344
        GC_push_one(info.__esi); 
 
345
        /* GC_push_one(info.__ebp);  */
 
346
        /* GC_push_one(info.__esp);  */
 
347
        GC_push_one(info.__ss); 
 
348
        GC_push_one(info.__eip); 
 
349
        GC_push_one(info.__cs); 
 
350
        GC_push_one(info.__ds); 
 
351
        GC_push_one(info.__es); 
 
352
        GC_push_one(info.__fs); 
 
353
        GC_push_one(info.__gs); 
 
354
#      else
248
355
        GC_push_one(info.eax); 
249
356
        GC_push_one(info.ebx); 
250
357
        GC_push_one(info.ecx); 
260
367
        GC_push_one(info.es); 
261
368
        GC_push_one(info.fs); 
262
369
        GC_push_one(info.gs); 
 
370
#      endif /* __DARWIN_UNIX03 */
263
371
#      endif /* !POWERPC */
264
372
      }
265
373
#     if DEBUG_THREADS