Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
For win64 it is cast unsigned long long.
[simgrid.git] / src / xbt / win32_ucontext.c
index 5dc8959..757eb43 100644 (file)
@@ -57,10 +57,19 @@ int makecontext(ucontext_t * ucp, void (*func) (), int argc, ...)
         return -1;\r
   }\r
   \r
-      /* Set the instruction and the stack pointer */ \r
-      ucp->uc_mcontext.Eip = (unsigned long) func;\r
+      /* Set the instruction and the stack pointer */\r
+  #ifdef I_X86_\r
+  ucp->uc_mcontext.Eip = (unsigned long) func;\r
   ucp->uc_mcontext.Esp = (unsigned long) sp - 4;\r
-  \r
+  #endif\r
+  #ifdef _IA64_\r
+  #  error "_IA64_"\r
+  #endif\r
+  #ifdef _AMD64_\r
+  ucp->uc_mcontext.Rip = (unsigned long long) func;\r
+  ucp->uc_mcontext.Rsp = (unsigned long long) sp - 8;\r
+  #endif\r
+\r
       /* Save/Restore the full machine context */ \r
       ucp->uc_mcontext.ContextFlags = CONTEXT_FULL;\r
   \r