summaryrefslogtreecommitdiff
path: root/libguile/threads.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2018-06-17 13:03:39 +0200
committerAndy Wingo <wingo@pobox.com>2018-06-17 13:41:03 +0200
commitf84ce5442e2602b6a41c48f596728d32d0aa8e47 (patch)
tree0679134bc6d2581d3eb7ddab8c009dcf7c0fa300 /libguile/threads.c
parent574f67d1b6e3b89171c7df8f043fc3891bd8a870 (diff)
downloadguile-f84ce5442e2602b6a41c48f596728d32d0aa8e47.tar.gz
Refactor handling of auxiliary stacks and setjmp/longjmp
* libguile/__scm.h (scm_i_jmp_buf): Remove definition, which was a shim for ia64. Instead, always use setjmp/longjmp and jmp_buf. * libguile/_scm.h (SCM_I_SETJMP, SCM_I_LONGJMP): Remove; instead use setjmp and longjmp. * libguile/continuations.c (capture_auxiliary_stack): (restore_auxiliary_stack): New helpers. (scm_i_make_continuation): Use capture_auxiliary_stack. (copy_stack_and_call): Use restore_auxiliary_stack. No need to stash the aux stack on the thread, either. * libguile/continuations.h (scm_t_contregs): Use SCM_HAVE_AUXILIARY_STACK to flag when to have an auxiliary_stack member. * libguile/control.h: * libguile/control.c (reify_partial_continuation, scm_c_abort): (scm_suspendable_continuation_p): Adapt to use setjmp/longjmp directly. * libguile/deprecated.h: Add deprecated scm_i_jmp_buf define. * libguile/dynstack.h: * libguile/dynstack.c (PROMPT_JMPBUF): (scm_dynstack_push_prompt, scm_dynstack_find_prompt): (scm_dynstack_wind_prompt): Adapt to jmp_buf type. * libguile/eval.c (eval): Use jmp_buf and setjmp directly. * libguile/gc-malloc.c: No need for ia64-specific things. * libguile/gc.c: No need for ia64-specific things. * libguile/gc.h: No need to declare scm_ia64_ar_bsp. * libguile/init.c: Remove typedef of setjmp_type for Cray, unused. * libguile/threads.c (guilify_self_1): No more pending_rbs_continuation in scm_i_thread, and register_backing_store_base is handled by libgc. (scm_ia64_ar_bsp): Remove definitions; inlined into continuations.c's capture_auxiliary_stack. * libguile/threads.h (scm_i_thread): jmpbuf member is plain jmp_buf. * libguile/throw.c (catch): Just use jmp_buf and setjmp. * libguile/vm-engine.c (VM_NAME): Adapt prototype to take jmp_buf pointer. * libguile/vm.c (vm_abort): Adapt jmp_buf types. (scm_call_n): Use setjmp.
Diffstat (limited to 'libguile/threads.c')
-rw-r--r--libguile/threads.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/libguile/threads.c b/libguile/threads.c
index a099eef0a..449d6fbf9 100644
--- a/libguile/threads.c
+++ b/libguile/threads.c
@@ -393,10 +393,6 @@ guilify_self_1 (struct GC_stack_base *base, int needs_unregister)
t.pending_asyncs = SCM_EOL;
t.block_asyncs = 1;
t.base = base->mem_base;
-#ifdef __ia64__
- t.register_backing_store_base = base->reg_base;
- t.pending_rbs_continuation = 0;
-#endif
t.continuation_root = SCM_EOL;
t.continuation_base = t.base;
scm_i_pthread_cond_init (&t.sleep_cond, NULL);
@@ -1850,38 +1846,6 @@ scm_init_threads_default_dynamic_state ()
}
-/* IA64-specific things. */
-
-#ifdef __ia64__
-# ifdef __hpux
-void *
-scm_ia64_ar_bsp (const void *ctx)
-{
- uint64_t bsp;
- __uc_get_ar_bsp (ctx, &bsp);
- return (void *) bsp;
-}
-# endif /* hpux */
-# ifdef linux
-# include <ucontext.h>
-void *
-scm_ia64_ar_bsp (const void *opaque)
-{
- const ucontext_t *ctx = opaque;
- return (void *) ctx->uc_mcontext.sc_ar_bsp;
-}
-# endif /* linux */
-# ifdef __FreeBSD__
-# include <ucontext.h>
-void *
-scm_ia64_ar_bsp (const void *opaque)
-{
- const ucontext_t *ctx = opaque;
- return (void *)(ctx->uc_mcontext.mc_special.bspstore
- + ctx->uc_mcontext.mc_special.ndirty);
-}
-# endif /* __FreeBSD__ */
-#endif /* __ia64__ */
/*