Lines Matching refs:co

88 void on_new_fiber(CoroutineUContext *co)  in on_new_fiber()  argument
91 co->tsan_co_fiber = __tsan_create_fiber(0); /* flags: sync on switch */ in on_new_fiber()
92 co->tsan_caller_fiber = __tsan_get_current_fiber(); in on_new_fiber()
133 CoroutineUContext *co, in start_switch_fiber_tsan() argument
138 co->tsan_caller_fiber : in start_switch_fiber_tsan()
139 co->tsan_co_fiber; in start_switch_fiber_tsan()
152 Coroutine *co; in coroutine_trampoline() local
160 co = &self->base; in coroutine_trampoline()
169 siglongjmp(*(sigjmp_buf *)co->entry_arg, 1); in coroutine_trampoline()
175 co->entry(co->entry_arg); in coroutine_trampoline()
176 qemu_coroutine_switch(co, co->caller, COROUTINE_TERMINATE); in coroutine_trampoline()
182 CoroutineUContext *co; in qemu_coroutine_new() local
200 co = g_malloc0(sizeof(*co)); in qemu_coroutine_new()
201 co->stack_size = COROUTINE_STACK_SIZE; in qemu_coroutine_new()
202 co->stack = qemu_alloc_stack(&co->stack_size); in qemu_coroutine_new()
204 co->unsafe_stack_size = COROUTINE_STACK_SIZE; in qemu_coroutine_new()
205 co->unsafe_stack = qemu_alloc_stack(&co->unsafe_stack_size); in qemu_coroutine_new()
207 co->base.entry_arg = &old_env; /* stash away our jmp_buf */ in qemu_coroutine_new()
210 uc.uc_stack.ss_sp = co->stack; in qemu_coroutine_new()
211 uc.uc_stack.ss_size = co->stack_size; in qemu_coroutine_new()
215 co->valgrind_stack_id = in qemu_coroutine_new()
216 VALGRIND_STACK_REGISTER(co->stack, co->stack + co->stack_size); in qemu_coroutine_new()
219 arg.p = co; in qemu_coroutine_new()
221 on_new_fiber(co); in qemu_coroutine_new()
227 start_switch_fiber_asan(&fake_stack_save, co->stack, co->stack_size); in qemu_coroutine_new()
229 co, false); /* false=not caller */ in qemu_coroutine_new()
242 void *usp = co->unsafe_stack + co->unsafe_stack_size; in qemu_coroutine_new()
251 return &co->base; in qemu_coroutine_new()
260 static inline void valgrind_stack_deregister(CoroutineUContext *co) in valgrind_stack_deregister() argument
262 VALGRIND_STACK_DEREGISTER(co->valgrind_stack_id); in valgrind_stack_deregister()
283 CoroutineUContext *co = DO_UPCAST(CoroutineUContext, base, co_); in qemu_coroutine_delete() local
292 valgrind_stack_deregister(co); in qemu_coroutine_delete()
295 qemu_free_stack(co->stack, co->stack_size); in qemu_coroutine_delete()
297 qemu_free_stack(co->unsafe_stack, co->unsafe_stack_size); in qemu_coroutine_delete()
299 g_free(co); in qemu_coroutine_delete()