diff options
author | samuel <samuel@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-20 10:17:44 +0000 |
---|---|---|
committer | samuel <samuel@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-20 10:17:44 +0000 |
commit | 0b5e1442f5425490f9c9d249683d05fe72b29ea9 (patch) | |
tree | 3f5601767fcc34fd5b8b4560c2d7e3b436fef6e5 /coroutine/win64/Context.asm | |
parent | d97c9280671444215da845bb71c2d624a08be4df (diff) | |
download | ruby-0b5e1442f5425490f9c9d249683d05fe72b29ea9.tar.gz |
Initial support for x64-mingw32
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'coroutine/win64/Context.asm')
-rw-r--r-- | coroutine/win64/Context.asm | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/coroutine/win64/Context.asm b/coroutine/win64/Context.asm index 4031c613fe..59673ffa3e 100644 --- a/coroutine/win64/Context.asm +++ b/coroutine/win64/Context.asm @@ -9,9 +9,8 @@ coroutine_transfer proc ; Save the thread information block: - push gs:[0x00] - push gs:[0x08] - push gs:[0x10] + push qword ptr gs:[8] + push qword ptr gs:[16] ; Save caller registers: push rbp @@ -23,12 +22,34 @@ coroutine_transfer proc push r14 push r15 + movaps [rsp - 24], xmm6 + movaps [rsp - 40], xmm7 + movaps [rsp - 56], xmm8 + movaps [rsp - 72], xmm9 + movaps [rsp - 88], xmm10 + movaps [rsp - 104], xmm11 + movaps [rsp - 120], xmm12 + movaps [rsp - 136], xmm13 + movaps [rsp - 152], xmm14 + movaps [rsp - 168], xmm15 + ; Save caller stack pointer: mov [rcx], rsp ; Restore callee stack pointer: mov rsp, [rdx] + movaps xmm15, [rsp - 168] + movaps xmm14, [rsp - 152] + movaps xmm13, [rsp - 136] + movaps xmm12, [rsp - 120] + movaps xmm11, [rsp - 104] + movaps xmm10, [rsp - 88] + movaps xmm9, [rsp - 72] + movaps xmm8, [rsp - 56] + movaps xmm7, [rsp - 40] + movaps xmm6, [rsp - 24] + ; Restore callee stack: pop r15 pop r14 @@ -40,9 +61,8 @@ coroutine_transfer proc pop rbp ; Restore the thread information block: - pop gs:[0x10] - pop gs:[0x08] - pop gs:[0x00] + pop qword ptr gs:[16] + pop qword ptr gs:[8] ; Put the first argument into the return value: mov rax, rcx @@ -51,4 +71,9 @@ coroutine_transfer proc ret coroutine_transfer endp +coroutine_trampoline proc + ; Do not remove this. This forces 16-byte alignment when entering the coroutine. + ret +coroutine_trampoline endp + end |