Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
reverting fiber context switch code for Win32
Browse files Browse the repository at this point in the history
  • Loading branch information
complexmath committed Sep 26, 2011
1 parent d7674fe commit 0c2ab0a
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/core/thread.d
Original file line number Diff line number Diff line change
Expand Up @@ -2939,13 +2939,13 @@ private
// save current stack state
push EBP;
mov EBP, ESP;
push EDI;
push ESI;
push EBX;
push EAX;
push dword ptr FS:[0];
push dword ptr FS:[4];
push dword ptr FS:[8];
push EAX;
push EBX;
push ESI;
push EDI;

// store oldp again with more accurate address
mov EAX, dword ptr 8[EBP];
Expand All @@ -2954,13 +2954,13 @@ private
mov ESP, dword ptr 12[EBP];

// load saved state from new stack
pop EAX;
pop EDI;
pop ESI;
pop EBX;
pop dword ptr FS:[8];
pop dword ptr FS:[4];
pop dword ptr FS:[0];
pop EBX;
pop ESI;
pop EDI;
pop EAX;
pop EBP;

// 'return' to complete switch
Expand Down Expand Up @@ -3698,10 +3698,8 @@ private:
version( AsmX86_Windows )
{
push( cast(size_t) &fiber_entryPoint ); // EIP
push( cast(size_t) m_ctxt.bstack ); // EBP
push( 0x00000000 ); // EDI
push( 0x00000000 ); // ESI
push( 0x00000000 ); // EBX
push( 0xFFFFFFFF ); // EBP
push( 0x00000000 ); // EAX
push( 0xFFFFFFFF ); // FS:[0]
version( StackGrowsDown )
{
Expand All @@ -3713,7 +3711,9 @@ private:
push( cast(size_t) m_ctxt.bstack ); // FS:[4]
push( cast(size_t) m_ctxt.bstack + m_size ); // FS:[8]
}
push( 0x00000000 ); // EAX
push( 0x00000000 ); // EBX
push( 0x00000000 ); // ESI
push( 0x00000000 ); // EDI
}
else version( AsmX86_64_Windows )
{
Expand Down

0 comments on commit 0c2ab0a

Please sign in to comment.