X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/63a6adf1a95b8b369815d7b25ff4929fc285f981..f07101941f4397554a6cee4fbaf3286137865064:/src/xbt/win32_ucontext.c?ds=sidebyside diff --git a/src/xbt/win32_ucontext.c b/src/xbt/win32_ucontext.c index 5dc89593f6..757eb43a70 100644 --- a/src/xbt/win32_ucontext.c +++ b/src/xbt/win32_ucontext.c @@ -57,10 +57,19 @@ int makecontext(ucontext_t * ucp, void (*func) (), int argc, ...) return -1; } - /* Set the instruction and the stack pointer */ - ucp->uc_mcontext.Eip = (unsigned long) func; + /* Set the instruction and the stack pointer */ + #ifdef I_X86_ + ucp->uc_mcontext.Eip = (unsigned long) func; ucp->uc_mcontext.Esp = (unsigned long) sp - 4; - + #endif + #ifdef _IA64_ + # error "_IA64_" + #endif + #ifdef _AMD64_ + ucp->uc_mcontext.Rip = (unsigned long long) func; + ucp->uc_mcontext.Rsp = (unsigned long long) sp - 8; + #endif + /* Save/Restore the full machine context */ ucp->uc_mcontext.ContextFlags = CONTEXT_FULL;