Changeset 641:d9927f20758b
- Timestamp:
- 10/03/08 03:11:41
(2 months ago)
- Author:
- Christian Kamm <kamm incasoftware de>
- branch:
- default
- Message:
Fiber support: clobber the registers we want restored on a context switch.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r640 |
r641 |
|
| 122 | 122 | // Fiber Entry Point and Context Switch |
|---|
| 123 | 123 | //////////////////////////////////////////////////////////////////////////////// |
|---|
| 124 | | @@ -2450,6 +2484,17 @@ |
|---|
| | 124 | @@ -2450,6 +2484,22 @@ |
|---|
| 125 | 125 | ret; |
|---|
| 126 | 126 | } |
|---|
| … | … | |
| 130 | 130 | + asm |
|---|
| 131 | 131 | + { |
|---|
| | 132 | + // clobber registers to save |
|---|
| | 133 | + inc EBX; |
|---|
| | 134 | + inc ESI; |
|---|
| | 135 | + inc EDI; |
|---|
| | 136 | + |
|---|
| 132 | 137 | + // store oldp again with more accurate address |
|---|
| 133 | 138 | + mov EAX, oldp; |
|---|
| … | … | |
| 140 | 145 | { |
|---|
| 141 | 146 | Fiber cfib = Fiber.getThis(); |
|---|
| 142 | | @@ -3115,6 +3160,13 @@ |
|---|
| | 147 | @@ -3115,6 +3165,16 @@ |
|---|
| 143 | 148 | push( 0x00000000 ); // ESI |
|---|
| 144 | 149 | push( 0x00000000 ); // EDI |
|---|
| … | … | |
| 147 | 152 | + { |
|---|
| 148 | 153 | + push( cast(size_t) &fiber_entryPoint ); // EIP |
|---|
| 149 | | + push( 0x00000000 ); // EBP |
|---|
| 150 | 154 | + push( 0x00000000 ); // newp |
|---|
| 151 | 155 | + push( 0x00000000 ); // oldp |
|---|
| | 156 | + push( 0x00000000 ); // EBP |
|---|
| | 157 | + push( 0x00000000 ); // EBX |
|---|
| | 158 | + push( 0x00000000 ); // ESI |
|---|
| | 159 | + push( 0x00000000 ); // EDI |
|---|
| 152 | 160 | + } |
|---|
| 153 | 161 | else version( AsmPPC_Posix ) |
|---|