1
/* Copyright (C) 1995,1996,1998,2000,2001,2004, 2006 Free Software Foundation, Inc.
1
/* Copyright (C) 1995,1996,1998,2000,2001,2004, 2006, 2008 Free Software Foundation, Inc.
3
3
* This library is free software; you can redistribute it and/or
4
4
* modify it under the terms of the GNU Lesser General Public
124
127
continuation->offset = continuation->stack - src;
125
128
memcpy (continuation->stack, src, sizeof (SCM_STACKITEM) * stack_size);
130
*first = !setjmp (continuation->jmpbuf);
128
continuation->fresh = 1;
129
getcontext (&continuation->ctx);
130
if (continuation->fresh)
132
134
continuation->backing_store_size =
133
(char *) scm_ia64_ar_bsp(&continuation->ctx)
135
(char *) scm_ia64_ar_bsp(&continuation->jmpbuf.ctx)
135
(char *) scm_ia64_register_backing_store_base ();
137
(char *) thread->register_backing_store_base;
136
138
continuation->backing_store = NULL;
137
139
continuation->backing_store =
138
140
scm_gc_malloc (continuation->backing_store_size,
139
141
"continuation backing store");
140
142
memcpy (continuation->backing_store,
141
(void *) scm_ia64_register_backing_store_base (),
143
(void *) thread->register_backing_store_base,
142
144
continuation->backing_store_size);
144
continuation->fresh = 0;
149
SCM ret = continuation->throw_value;
151
continuation->throw_value = SCM_BOOL_F;
154
#else /* !__ia64__ */
155
if (setjmp (continuation->jmpbuf))
157
SCM ret = continuation->throw_value;
159
continuation->throw_value = SCM_BOOL_F;
167
#endif /* !__ia64__ */
145
#endif /* __ia64__ */
150
SCM ret = continuation->throw_value;
151
continuation->throw_value = SCM_BOOL_F;
218
204
copy_stack_data *d = (copy_stack_data *)data;
219
205
memcpy (d->dst, d->continuation->stack,
220
206
sizeof (SCM_STACKITEM) * d->continuation->num_stack_items);
208
SCM_I_CURRENT_THREAD->pending_rbs_continuation = d->continuation;
235
224
scm_i_set_last_debug_frame (continuation->dframe);
237
226
continuation->throw_value = val;
239
memcpy (scm_ia64_register_backing_store_base (),
240
continuation->backing_store,
241
continuation->backing_store_size);
242
setcontext (&continuation->ctx);
244
227
longjmp (continuation->jmpbuf, 1);
232
scm_ia64_longjmp (jmp_buf *JB, int VAL)
234
scm_i_thread *t = SCM_I_CURRENT_THREAD;
236
if (t->pending_rbs_continuation)
238
memcpy (t->register_backing_store_base,
239
t->pending_rbs_continuation->backing_store,
240
t->pending_rbs_continuation->backing_store_size);
241
t->pending_rbs_continuation = NULL;
243
setcontext (&JB->ctx);
248
247
/* Call grow_stack until the stack space is large enough, then, as the current
249
248
* stack frame might get overwritten, let copy_stack_and_call perform the