Changeset 818:e8f8cafcaa62
- Timestamp:
- 12/01/08 14:26:32
(1 month ago)
- Author:
- Christian Kamm <kamm incasoftware de>
- branch:
- default
- Message:
Fix fibers in tango patch
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r795 |
r818 |
|
| 184 | 184 | { |
|---|
| 185 | 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 | } |
|---|
| … | … | |
| 193 | 222 | // Fiber |
|---|
| 194 | 223 | //////////////////////////////////////////////////////////////////////////////// |
|---|
| 195 | | @@ -3177,6 +3241,22 @@ |
|---|
| | 224 | @@ -3177,6 +3263,22 @@ |
|---|
| 196 | 225 | push( 0x00000000 ); // ESI |
|---|
| 197 | 226 | push( 0x00000000 ); // EDI |
|---|
| … | … | |
| 216 | 245 | { |
|---|
| 217 | 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 | 247 | Index: lib/gc/basic/gcx.d |
|---|
| 248 | 248 | =================================================================== |
|---|