# HG changeset patch # User Christian Kamm # Date 1223017901 -7200 # Node ID d9927f20758b33a4013efc77b1f95692dd7a6e24 # Parent c2a342b5d8e5db1c2763305517d9daf22d4613fc Fiber support: clobber the registers we want restored on a context switch. diff -r c2a342b5d8e5 -r d9927f20758b runtime/llvmdc.diff --- a/runtime/llvmdc.diff Fri Oct 03 00:42:17 2008 +0200 +++ b/runtime/llvmdc.diff Fri Oct 03 09:11:41 2008 +0200 @@ -121,7 +121,7 @@ //////////////////////////////////////////////////////////////////////////////// // Fiber Entry Point and Context Switch //////////////////////////////////////////////////////////////////////////////// -@@ -2450,6 +2484,17 @@ +@@ -2450,6 +2484,22 @@ ret; } } @@ -129,6 +129,11 @@ + { + asm + { ++ // clobber registers to save ++ inc EBX; ++ inc ESI; ++ inc EDI; ++ + // store oldp again with more accurate address + mov EAX, oldp; + mov [EAX], ESP; @@ -139,16 +144,19 @@ else static if( is( ucontext_t ) ) { Fiber cfib = Fiber.getThis(); -@@ -3115,6 +3160,13 @@ +@@ -3115,6 +3165,16 @@ push( 0x00000000 ); // ESI push( 0x00000000 ); // EDI } + else version( LLVM_AsmX86_Posix ) + { + push( cast(size_t) &fiber_entryPoint ); // EIP -+ push( 0x00000000 ); // EBP + push( 0x00000000 ); // newp + push( 0x00000000 ); // oldp ++ push( 0x00000000 ); // EBP ++ push( 0x00000000 ); // EBX ++ push( 0x00000000 ); // ESI ++ push( 0x00000000 ); // EDI + } else version( AsmPPC_Posix ) {