Skip to content

Commit

Permalink
zcontext 修正 fpu 问题。
Browse files Browse the repository at this point in the history
  • Loading branch information
microcai committed Jan 6, 2025
1 parent a8eba13 commit 2eacc06
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions uasync/zcontext_asm/zcontext_x86_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,17 @@ zcontext_swap: // zcontext_swap(zcontext_t* from, zcontext_t* to, swap_hook_func
// 返回
ret


.align 16
.global zcontext_entry_point
.section .text.zcontext_entry_point, "x"
default_mmx_ctl:
.int 0x1f80
default_fpu_ctl:
.int 0x37f
zcontext_entry_point:
ldmxcsr -0xf(%rip)
fldcw -0x11(%rip)
pop %rbx
pop ARG1_REG
mov %rax, ARG2_REG
Expand Down Expand Up @@ -217,3 +224,6 @@ zcontext_swap_preserve_none: // zcontext_swap2(zcontext_t* from, zcontext_t* to,
pop NONE_PRESERVE_ARG3_REG ; // pop+jump = ret !
1:
jmp * NONE_PRESERVE_ARG3_REG // tail call optimization


.section .note.GNU-stack,"",%progbits

0 comments on commit 2eacc06

Please sign in to comment.