summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2010-04-02 20:21:21 +0000
committerroot <root>2010-04-02 20:21:21 +0000
commit4edadfae7be138a73961a8b78064464ff946cf15 (patch)
treeb9eaa94e9216db0f3eb3f4ef08b35e6a4a602933
parentbd27a6a2c6fa93b10d3ee6484ad5b8da56a8bff4 (diff)
*** empty log message ***rel-5_23
-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"