diff --git a/try.c b/try.c index 254178f38d91ced706ed7744cbe8750b73a817e8..4fa273cf432bcac3a9ac9fcc1370878bc59a6695 100644 --- a/try.c +++ b/try.c @@ -49,30 +49,17 @@ void switch_to_ctx(ctx_t *pctx) "\n\t" "movl %%ebp, %1" : "=r"(current_ctx->esp), "=r"(current_ctx->ebp)); - - current_ctx = pctx; - - // Basculer vers pctx - asm("movl %0, %%esp" - "\n\t" - "movl %1, %%ebp " - : - : "r"(pctx->esp), "r"(pctx->ebp)); } - else - { - current_ctx = pctx; - asm("movl %%esp, %0" - "\n\t" - "movl %%ebp, %1" - : "=r"(current_ctx->esp), "=r"(current_ctx->ebp)); - } + current_ctx = pctx; + asm("movl %%esp, %0" + "\n\t" + "movl %%ebp, %1" + : + : "r"(current_ctx->esp), "r"(current_ctx->ebp)); if (current_ctx->status == CTX_INIT) - { start_ctx(); - } } void start_ctx()