ARGOBOTS
dce6e727ffc4ca5b3ffc04cb9517c6689be51ec5
|
Go to the documentation of this file.
6 #ifndef ABTD_UCONTEXT_H_INCLUDED
7 #define ABTD_UCONTEXT_H_INCLUDED
45 #if SIZEOF_VOID_P == 8
47 ((uintptr_t)((uint32_t)arg2)));
48 #elif SIZEOF_VOID_P == 4
51 #error "Unknown pointer size."
64 void *p_stacktop,
size_t stacksize)
69 int ret = getcontext(&p_ctx->
uctx);
96 int ret = getcontext(&p_ctx->
uctx);
123 p_ctx->
uctx.uc_link = NULL;
125 p_ctx->
uctx.uc_stack.ss_sp = p_stack;
128 #if SIZEOF_VOID_P == 8
129 int arg_upper = (int)(((uintptr_t)p_ctx) >> 32);
130 int arg_lower = (int)(((uintptr_t)p_ctx) >> 0);
133 #elif SIZEOF_VOID_P == 4
134 int arg = (int)((uintptr_t)p_ctx);
137 #error "Unknown pointer size."
155 int ret = swapcontext(&p_old->
uctx, &p_new->
uctx);
178 int ret = setcontext(&p_new->
uctx);
195 void (*f_cb)(
void *),
void *cb_arg)
202 int ret = swapcontext(&p_old->
uctx, &p_new->
uctx);
214 void (*f_cb)(
void *),
void *cb_arg)
223 void (*f_cb)(
void *),
void *cb_arg)
228 int ret = setcontext(&p_new->
uctx);
243 void (*peek_func)(
void *),
247 ucontext_t self_uctx;
252 int ret = swapcontext(&self_uctx, &p_ctx->
uctx);
int ABT_bool
Boolean type.
static ABTU_noreturn void ABTD_ythread_context_start_and_jump(ABTD_ythread_context *p_new)
static ABTU_noreturn void ABTD_ythread_context_jump(ABTD_ythread_context *p_new)
static ABTU_noreturn void ABTD_ythread_context_start_and_jump_with_call(ABTD_ythread_context *p_new, void(*f_cb)(void *), void *cb_arg)
static void * ABTD_ythread_context_get_stacktop(ABTD_ythread_context *p_ctx)
static void ABTD_ythread_context_start_and_switch(ABTD_ythread_context *p_old, ABTD_ythread_context *p_new)
static void ABTD_atomic_relaxed_store_ythread_context_ptr(ABTD_ythread_context_atomic_ptr *ptr, ABTD_ythread_context *p_ctx)
void(* peek_func)(void *)
ABTD_ythread_context_atomic_ptr p_link
#define ABTU_unreachable()
static ABT_bool ABTD_ythread_context_is_started(const ABTD_ythread_context *p_ctx)
static void ABTD_ythread_context_lazy_unset_stack(ABTD_ythread_context *p_ctx)
static void ABTD_ythread_context_start_and_switch_with_call(ABTD_ythread_context *p_old, ABTD_ythread_context *p_new, void(*f_cb)(void *), void *cb_arg)
static void ABTD_ythread_context_switch_with_call(ABTD_ythread_context *p_old, ABTD_ythread_context *p_new, void(*f_cb)(void *), void *cb_arg)
static void ABTD_ythread_context_reinit(ABTD_ythread_context *p_ctx)
static void ABTD_ythread_context_lazy_set_stack(ABTD_ythread_context *p_ctx, void *p_stacktop)
#define ABTI_ASSERT(cond)
static void ABTDI_ythread_context_make(ABTD_ythread_context *p_ctx)
static void ABTD_ythread_context_switch(ABTD_ythread_context *p_old, ABTD_ythread_context *p_new)
static ABTU_noreturn void ABTD_ythread_context_jump_with_call(ABTD_ythread_context *p_new, void(*f_cb)(void *), void *cb_arg)
#define ABTU_unlikely(cond)
#define ABT_TRUE
True constant for ABT_bool.
#define ABT_FALSE
False constant for ABT_bool.
#define ABTI_UB_ASSERT(cond)
static void ABTD_ythread_context_init_lazy(ABTD_ythread_context *p_ctx, size_t stacksize)
static void ABTD_ythread_context_init(ABTD_ythread_context *p_ctx, void *p_stacktop, size_t stacksize)
static void ABTDI_ucontext_check_peeked(ABTD_ythread_context *p_self)
static size_t ABTD_ythread_context_get_stacksize(ABTD_ythread_context *p_ctx)
void ABTD_ythread_func_wrapper(ABTD_ythread_context *p_arg)
static void ABTD_ucontext_wrapper(int arg1, int arg2)
static ABT_bool ABTD_ythread_context_peek(ABTD_ythread_context *p_ctx, void(*peek_func)(void *), void *arg)
static ABT_bool ABTD_ythread_context_has_stack(const ABTD_ythread_context *p_ctx)