diff options
author | Neil Jerram <neil@ossau.uklinux.net> | 2006-10-25 22:37:24 +0000 |
---|---|---|
committer | Neil Jerram <neil@ossau.uklinux.net> | 2006-10-25 22:37:24 +0000 |
commit | 9a5fa6e98a0078e6f3e47dd72d1545877ea862f7 (patch) | |
tree | 54c9c138c7471093a5a0991023aae85b2f5f13ab /libguile/continuations.c | |
parent | ba6984d09bdc2298eb331f8ddedab3844e777e39 (diff) | |
download | guile-9a5fa6e98a0078e6f3e47dd72d1545877ea862f7.tar.gz |
* configure.in: New check for uca lib (needed for IA64 on HP-UX).
* threads.c (SCM_MARK_BACKING_STORE): Use scm_ia64_ar_bsp() and
scm_ia64_register_backing_store_base() instead of Linux-specific
implementations.
* gc.h (scm_ia64_register_backing_store_base, scm_ia64_ar_bsp):
New declarations.
* gc.c (__libc_ia64_register_backing_store_base): Declaration
removed.
(scm_ia64_register_backing_store_base, scm_ia64_ar_bsp): New, with
implementations for Linux and HP-UX.
* coop-pthreads.c (SCM_MARK_BACKING_STORE): Use scm_ia64_ar_bsp()
and scm_ia64_register_backing_store_base() instead of
Linux-specific implementations.
* continuations.h (__libc_ia64_register_backing_store_base):
Declaration removed.
(scm_t_contregs): New "fresh" field.
* continuations.c (ia64_getcontext): Removed.
(scm_make_continuation): Use continuation fresh field instead of
interpreting getcontext return values (which isn't portable). Use
scm_ia64_ar_bsp() and scm_ia64_register_backing_store_base()
instead of Linux-specific implementations.
(copy_stack_and_call): Use scm_ia64_register_backing_store_base()
instead of Linux-specific implementation.
* _scm.h (__ia64__): Also detect __ia64.
Diffstat (limited to 'libguile/continuations.c')
-rw-r--r-- | libguile/continuations.c | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/libguile/continuations.c b/libguile/continuations.c index 5ae89d836..39785a528 100644 --- a/libguile/continuations.c +++ b/libguile/continuations.c @@ -92,22 +92,6 @@ continuation_print (SCM obj, SCM port, scm_print_state *state SCM_UNUSED) return 1; } -#ifdef __ia64__ -/* Extern declaration of getcontext()/setcontext() in order to redefine - getcontext() since on ia64-linux the second return value indicates whether - it returned from getcontext() itself or by running setcontext(). */ -struct rv -{ - long retval; - long first_return; -}; - -#ifdef __GNUC__ -__attribute__ ((returns_twice)) -#endif /* __GNUC__ */ -extern struct rv ia64_getcontext (ucontext_t *) __asm__ ("getcontext"); -#endif /* __ia64__ */ - /* this may return more than once: the first time with the escape procedure, then subsequently with the value to be passed to the continuation. */ @@ -120,9 +104,6 @@ scm_make_continuation (int *first) scm_t_contregs *continuation; long stack_size; SCM_STACKITEM * src; -#ifdef __ia64__ - struct rv rv; -#endif /* __ia64__ */ SCM_FLUSH_REGISTER_WINDOWS; stack_size = scm_stack_size (thread->continuation_base); @@ -144,20 +125,23 @@ scm_make_continuation (int *first) memcpy (continuation->stack, src, sizeof (SCM_STACKITEM) * stack_size); #ifdef __ia64__ - rv = ia64_getcontext (&continuation->ctx); - if (rv.first_return) + continuation->fresh = 1; + getcontext (&continuation->ctx); + if (continuation->fresh) { - continuation->backing_store_size = - continuation->ctx.uc_mcontext.sc_ar_bsp - - (unsigned long) __libc_ia64_register_backing_store_base; + continuation->backing_store_size = + (char *) scm_ia64_ar_bsp(&continuation->ctx) + - + (char *) scm_ia64_register_backing_store_base (); continuation->backing_store = NULL; continuation->backing_store = scm_gc_malloc (continuation->backing_store_size, "continuation backing store"); memcpy (continuation->backing_store, - (void *) __libc_ia64_register_backing_store_base, + (void *) scm_ia64_register_backing_store_base (), continuation->backing_store_size); *first = 1; + continuation->fresh = 0; return cont; } else @@ -252,7 +236,7 @@ copy_stack_and_call (scm_t_contregs *continuation, SCM val, continuation->throw_value = val; #ifdef __ia64__ - memcpy ((void *) __libc_ia64_register_backing_store_base, + memcpy (scm_ia64_register_backing_store_base (), continuation->backing_store, continuation->backing_store_size); setcontext (&continuation->ctx); |