From 5657e53c4954e6cbb78b70f7f8dbd511284d0e11 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Mon, 1 Dec 2008 20:26:32 +0100 Subject: [PATCH] Fix fibers in tango patch --- runtime/ldc.diff | 72 ++++++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/runtime/ldc.diff b/runtime/ldc.diff index e21bf3f4..79354ff5 100644 --- a/runtime/ldc.diff +++ b/runtime/ldc.diff @@ -183,41 +183,9 @@ Index: lib/common/tango/core/Thread.d 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 @@ Index: lib/common/tango/core/Thread.d ++/ 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)