comparison runtime/ldc.diff @ 818:e8f8cafcaa62

Fix fibers in tango patch
author Christian Kamm <kamm incasoftware de>
date Mon, 01 Dec 2008 20:26:32 +0100
parents 06ba66bc0689
children 43178a913a28
comparison
equal deleted inserted replaced
817:f5d5bc9295b1 818:e8f8cafcaa62
181 +const size_t PAGESIZE; 181 +const size_t PAGESIZE;
182 + 182 +
183 static this() 183 static this()
184 { 184 {
185 static if( is( typeof( GetSystemInfo ) ) ) 185 static if( is( typeof( GetSystemInfo ) ) )
186 @@ -2522,7 +2586,7 @@ 186 @@ -2510,6 +2574,28 @@
187 ret;
188 }
189 }
190 + else version( LLVM_AsmX86_Posix )
191 + {
192 + asm
193 + {
194 + // clobber registers to save
195 + inc EBX;
196 + inc ESI;
197 + inc EDI;
198 +
199 + // store oldp again with more accurate address
200 + mov EAX, oldp;
201 + mov [EAX], ESP;
202 + // load newp to begin context switch
203 + mov ESP, newp;
204 + }
205 + }
206 +/+
207 + version( LLVM_AsmX86_64_Posix )
208 + {
209 + //TODO: Fiber implementation here
210 + }
211 ++/
212 else static if( is( ucontext_t ) )
213 {
214 Fiber cfib = Fiber.getThis();
215 @@ -2522,7 +2608,7 @@
187 } 216 }
188 } 217 }
189 218
190 - 219 -
191 +extern(C) int printf(char*, ...); 220 +extern(C) int printf(char*, ...);
192 //////////////////////////////////////////////////////////////////////////////// 221 ////////////////////////////////////////////////////////////////////////////////
193 // Fiber 222 // Fiber
194 //////////////////////////////////////////////////////////////////////////////// 223 ////////////////////////////////////////////////////////////////////////////////
195 @@ -3177,6 +3241,22 @@ 224 @@ -3177,6 +3263,22 @@
196 push( 0x00000000 ); // ESI 225 push( 0x00000000 ); // ESI
197 push( 0x00000000 ); // EDI 226 push( 0x00000000 ); // EDI
198 } 227 }
199 + else version( LLVM_AsmX86_Posix ) 228 + else version( LLVM_AsmX86_Posix )
200 + { 229 + {
213 + } 242 + }
214 ++/ 243 ++/
215 else version( AsmPPC_Posix ) 244 else version( AsmPPC_Posix )
216 { 245 {
217 version( StackGrowsDown ) 246 version( StackGrowsDown )
218 @@ -3204,6 +3284,28 @@
219
220 assert( cast(uint) pstack & 0x0f == 0 );
221 }
222 + else version( LLVM_AsmX86_Posix )
223 + {
224 + asm
225 + {
226 + // clobber registers to save
227 + inc EBX;
228 + inc ESI;
229 + inc EDI;
230 +
231 + // store oldp again with more accurate address
232 + mov EAX, oldp;
233 + mov [EAX], ESP;
234 + // load newp to begin context switch
235 + mov ESP, newp;
236 + }
237 + }
238 +/+
239 + version( LLVM_AsmX86_64_Posix )
240 + {
241 + //TODO: Fiber implementation here
242 + }
243 ++/
244 else static if( is( ucontext_t ) )
245 {
246 getcontext( &m_utxt );
247 Index: lib/gc/basic/gcx.d 247 Index: lib/gc/basic/gcx.d
248 =================================================================== 248 ===================================================================
249 --- lib/gc/basic/gcx.d (revision 4134) 249 --- lib/gc/basic/gcx.d (revision 4134)
250 +++ lib/gc/basic/gcx.d (working copy) 250 +++ lib/gc/basic/gcx.d (working copy)
251 @@ -65,6 +65,13 @@ 251 @@ -65,6 +65,13 @@