X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fbsd-os.c;h=64aba2cd0a569f71d59b3fb0113af6780f9162f6;hb=d501bef3a93da4f14f1e85b852c2e01ee1df2907;hp=bcca635806124cd7a53e0372826438920b06a95d;hpb=34dcb46f78a01d543756703d7ccdf3d999a134d0;p=sbcl.git diff --git a/src/runtime/bsd-os.c b/src/runtime/bsd-os.c index bcca635..64aba2c 100644 --- a/src/runtime/bsd-os.c +++ b/src/runtime/bsd-os.c @@ -29,11 +29,11 @@ #include "interr.h" #include "lispregs.h" #include "sbcl.h" +#include "thread.h" #include #include /* #include */ -#include #include "validate.h" vm_size_t os_vm_page_size; @@ -251,3 +251,30 @@ os_install_interrupt_handlers(void) } #endif /* defined GENCGC */ + +/* threads */ + +/* no threading in any *BSD variant on any CPU (yet? in sbcl-0.8.0 anyway) */ +#ifdef LISP_FEATURE_SB_THREAD +#error "Define threading support functions" +#else +struct thread *arch_os_get_current_thread() { + return all_threads; +} +int arch_os_thread_init(struct thread *thread) { + stack_t sigstack; +#ifdef LISP_FEATURE_C_STACK_IS_CONTROL_STACK + /* Signal handlers are run on the control stack, so if it is exhausted + * we had better use an alternate stack for whatever signal tells us + * we've exhausted it */ + sigstack.ss_sp=((void *) thread)+dynamic_values_bytes; + sigstack.ss_flags=0; + sigstack.ss_size = 32*SIGSTKSZ; + sigaltstack(&sigstack,0); +#endif + return 1; /* success */ +} +int arch_os_thread_cleanup(struct thread *thread) { + return 1; /* success */ +} +#endif