# HG changeset patch # User Christian Kamm # Date 1228159592 -3600 # Node ID e8f8cafcaa620551816dfa159b4a279047656159 # Parent f5d5bc9295b172499221f55b21751ed5e61116ba Fix fibers in tango patch diff -r f5d5bc9295b1 -r e8f8cafcaa62 runtime/ldc.diff --- a/runtime/ldc.diff Mon Dec 01 19:51:45 2008 +0100 +++ b/runtime/ldc.diff Mon Dec 01 20:26:32 2008 +0100 @@ -183,41 +183,9 @@ static this() { static if( is( typeof( GetSystemInfo ) ) ) -@@ -2522,7 +2586,7 @@ - } - } - -- -+extern(C) int printf(char*, ...); - //////////////////////////////////////////////////////////////////////////////// - // Fiber - //////////////////////////////////////////////////////////////////////////////// -@@ -3177,6 +3241,22 @@ - push( 0x00000000 ); // ESI - push( 0x00000000 ); // EDI - } -+ else version( LLVM_AsmX86_Posix ) -+ { -+ push( cast(size_t) &fiber_entryPoint ); // EIP -+ push( 0x00000000 ); // newp -+ push( 0x00000000 ); // oldp -+ push( 0x00000000 ); // EBP -+ push( 0x00000000 ); // EBX -+ push( 0x00000000 ); // ESI -+ push( 0x00000000 ); // EDI -+ } -+//TODO: Implement x86-64 fibers -+/+ -+ else version( LLVM_AsmX86_Posix ) -+ { -+ } -++/ - else version( AsmPPC_Posix ) - { - version( StackGrowsDown ) -@@ -3204,6 +3284,28 @@ - - assert( cast(uint) pstack & 0x0f == 0 ); +@@ -2510,6 +2574,28 @@ + ret; + } } + else version( LLVM_AsmX86_Posix ) + { @@ -243,7 +211,39 @@ ++/ else static if( is( ucontext_t ) ) { - getcontext( &m_utxt ); + Fiber cfib = Fiber.getThis(); +@@ -2522,7 +2608,7 @@ + } + } + +- ++extern(C) int printf(char*, ...); + //////////////////////////////////////////////////////////////////////////////// + // Fiber + //////////////////////////////////////////////////////////////////////////////// +@@ -3177,6 +3263,22 @@ + push( 0x00000000 ); // ESI + push( 0x00000000 ); // EDI + } ++ else version( LLVM_AsmX86_Posix ) ++ { ++ push( cast(size_t) &fiber_entryPoint ); // EIP ++ push( 0x00000000 ); // newp ++ push( 0x00000000 ); // oldp ++ push( 0x00000000 ); // EBP ++ push( 0x00000000 ); // EBX ++ push( 0x00000000 ); // ESI ++ push( 0x00000000 ); // EDI ++ } ++//TODO: Implement x86-64 fibers ++/+ ++ else version( LLVM_AsmX86_Posix ) ++ { ++ } +++/ + else version( AsmPPC_Posix ) + { + version( StackGrowsDown ) Index: lib/gc/basic/gcx.d =================================================================== --- lib/gc/basic/gcx.d (revision 4134)