changeset 818:e8f8cafcaa62

Fix fibers in tango patch
author Christian Kamm <kamm incasoftware de>
date Mon, 01 Dec 2008 20:26:32 +0100
parents f5d5bc9295b1
children 446263a8a30d
files runtime/ldc.diff
diffstat 1 files changed, 36 insertions(+), 36 deletions(-) [+]
line wrap: on
line 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)