-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from oli-obk/fiber
Use fibers on windows
- Loading branch information
Showing
11 changed files
with
389 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include <windows.h> | ||
|
||
PVOID __stacker_get_current_fiber() { | ||
return GetCurrentFiber(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,8 @@ | ||
_text SEGMENT | ||
|
||
__stacker_black_box PROC | ||
RET | ||
__stacker_black_box ENDP | ||
|
||
__stacker_stack_pointer PROC | ||
MOV RAX, RSP | ||
RET | ||
__stacker_stack_pointer ENDP | ||
|
||
__stacker_switch_stacks PROC | ||
PUSH RBP | ||
MOV RBP, RSP | ||
MOV RSP, RCX ; switch to our new stack | ||
MOV RCX, R8 ; move the data pointer to the first argument | ||
CALL RDX ; call our function pointer | ||
MOV RSP, RBP ; restore the old stack pointer | ||
POP RBP | ||
RET | ||
__stacker_switch_stacks ENDP | ||
|
||
END | ||
END |
Oops, something went wrong.