X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fruntime.h;h=01f40318c4653635bed8ec2bead947e6c74aa5a7;hb=619189958917e80786d5bb2efa4dc38d908d2553;hp=9905632f37c30450590a3a1d2769c240a3949e2d;hpb=f87f749ba5ffeb2e51b28c83d01ac7e33a5ca76d;p=sbcl.git diff --git a/src/runtime/runtime.h b/src/runtime/runtime.h index 9905632..01f4031 100644 --- a/src/runtime/runtime.h +++ b/src/runtime/runtime.h @@ -15,14 +15,59 @@ #ifndef _SBCL_RUNTIME_H_ #define _SBCL_RUNTIME_H_ -/*#define QSHOW */ /* Enable low-level debugging output? */ +#if defined(LISP_FEATURE_SB_THREAD) +#define thread_self() pthread_self() +#define thread_kill pthread_kill +#define thread_sigmask pthread_sigmask +#define thread_mutex_lock(l) pthread_mutex_lock(l) +#define thread_mutex_unlock(l) pthread_mutex_unlock(l) +#else +#define thread_self() 0 +#define thread_kill kill_safely +#define thread_sigmask sigprocmask +#define thread_mutex_lock(l) 0 +#define thread_mutex_unlock(l) 0 +#endif + +/* #define QSHOW */ /* Enable low-level debugging output? */ +/* #define QSHOW_SAFE */ /* Enable blocking interrupts for each SHOW. */ #ifdef QSHOW -#define FSHOW(args) fprintf args + +#ifdef QSHOW_SAFE + +#include +extern sigset_t blockable_sigset; + +#define QSHOW_BLOCK \ + sigset_t oldset; \ + thread_sigmask(SIG_BLOCK, &blockable_sigset, &oldset); +#define QSHOW_UNBLOCK thread_sigmask(SIG_SETMASK,&oldset,0); +#else +#define QSHOW_BLOCK +#define QSHOW_UNBLOCK +#endif + +#ifdef LISP_FEATURE_SB_THREAD +#define QSHOW_PREFIX fprintf(stderr, "%lu ", pthread_self()); +#else +#define QSHOW_PREFIX +#endif + +#define FSHOW(args) \ + do { \ + QSHOW_BLOCK \ + QSHOW_PREFIX \ + fprintf args; \ + QSHOW_UNBLOCK \ + } while (0) #define SHOW(string) FSHOW((stderr, "/%s\n", string)) + #else + #define FSHOW(args) #define SHOW(string) + #endif /* Enable extra-verbose low-level debugging output for signals? (You @@ -197,4 +242,13 @@ typedef int boolean; extern void *successful_malloc (size_t size); extern char *copied_string (char *string); +#define RUNTIME_OPTIONS_MAGIC 0x31EBF355 +/* 1 for magic, 1 for boolean, 2 for struct runtime_options fields */ +#define RUNTIME_OPTIONS_WORDS (1 + 1 + 2) + +struct runtime_options { + size_t dynamic_space_size; + size_t thread_control_stack_size; +}; + #endif /* _SBCL_RUNTIME_H_ */