-/** A better makecontext
- *
- * Makecontext expects integer arguments, we the context
- * variable is decomposed into a serie of integers and
- * each integer is passed as argument to makecontext. */
-static void simgrid_makecontext(ucontext_t* ucp, void (*func)(int first, ...), void* arg)
-{
- int ctx_addr[CTX_ADDR_LEN];
- memcpy(ctx_addr, &arg, sizeof(void*));
- switch (CTX_ADDR_LEN) {
- case 1:
- makecontext(ucp, (void (*)())func, 1, ctx_addr[0]);
- break;
- case 2:
- makecontext(ucp, (void (*)()) func, 2, ctx_addr[0], ctx_addr[1]);
- break;
- default:
- xbt_die("Ucontexts are not supported on this arch yet (addr len = %zu/%zu = %zu)", sizeof(void*), sizeof(int), CTX_ADDR_LEN);
- }
-}
-
-XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context);
-
-namespace simgrid {
-namespace kernel {
-namespace context {
- class UContext;
- class SerialUContext;
- class ParallelUContext;
- class UContextFactory;
-}}}
-
-#if HAVE_THREAD_CONTEXTS
-static xbt_parmap_t sysv_parmap;
-static simgrid::kernel::context::ParallelUContext** sysv_workers_context; /* space to save the worker's context in each thread */
-static uintptr_t sysv_threads_working; /* number of threads that have started their work */
-static xbt_os_thread_key_t sysv_worker_id_key; /* thread-specific storage for the thread id */
-#endif
-static unsigned long sysv_process_index = 0; /* index of the next process to run in the
- * list of runnable processes */
-static simgrid::kernel::context::UContext* sysv_maestro_context;
-static bool sysv_parallel;