summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coro.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/coro.c b/coro.c
index 188c0de..cbc5eeb 100644
--- a/coro.c
+++ b/coro.c
@@ -117,6 +117,8 @@ trampoline (int sig)
".globl coro_transfer\n"
".type coro_transfer, @function\n"
"coro_transfer:\n"
+ /* windows, of course, gives a shit on the amd64 ABI and uses different registers */
+ /* http://blogs.msdn.com/freik/archive/2005/03/17/398200.aspx */
#if __amd64
#define NUM_SAVED 6
"\tpush %rbp\n"
@@ -126,16 +128,16 @@ trampoline (int sig)
"\tpush %r14\n"
"\tpush %r15\n"
#if CORO_WIN_TIB
- "\tpush %fs:0x0\n"
- "\tpush %fs:0x8\n"
- "\tpush %fs:0xc\n"
+ "\tpush %gs:0x0\n"
+ "\tpush %gs:0x8\n"
+ "\tpush %gs:0xc\n"
#endif
"\tmov %rsp, (%rdi)\n"
"\tmov (%rsi), %rsp\n"
#if CORO_WIN_TIB
- "\tpop %fs:0xc\n"
- "\tpop %fs:0x8\n"
- "\tpop %fs:0x0\n"
+ "\tpop %gs:0xc\n"
+ "\tpop %gs:0x8\n"
+ "\tpop %gs:0x0\n"
#endif
"\tpop %r15\n"
"\tpop %r14\n"