Skip to content

Commit fe6dcd3

Browse files
committed
Update/fix the i386 and mips64 assembly. Looks like there was an error changing away from the old API.
1 parent dbfd50e commit fe6dcd3

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

src/asm/i386/switch_i386_sysv_elf_gas.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ yafl_switch:
7777
movl 0x14(%esp), %ebx /* restore EBX */
7878
movl 0x18(%esp), %ebp /* restore EBP */
7979

80-
leal 0x24(%esp), %esp /* prepare stack */
80+
leal 0x20(%esp), %esp /* prepare stack for direct data return */
8181

8282
/* return and pass data directly */
8383
movl %edx, %eax

src/asm/mips64/switch_mips64_n64_elf_gas.S

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ yafl_switch:
7979
s.d $f31, 56($sp) # save F31
8080
#endif
8181

82-
# store SP (pointing to old context-data) in v0 as return
83-
move $v0, $sp
82+
# save current context through the first argument pointer
83+
sd $sp, 0($a0)
8484

85-
# get SP (pointing to new context-data) from a0 param
86-
move $sp, $a0
85+
# restore target context from the second argument
86+
move $sp, $a1
8787

8888
#if defined(__mips_hard_float)
8989
l.d $f24, 0($sp) # restore F24
@@ -113,8 +113,9 @@ yafl_switch:
113113
# adjust stack
114114
daddiu $sp, $sp, 160
115115

116-
move $a0, $v0 # move old sp from v0 to a0 as param
117-
move $v1, $a1 # move *data from a1 to v1 as return
116+
# return and pass data directly
117+
move $v0, $a2
118+
move $a0, $a2
118119

119120
# jump to context
120121
jr $t9

0 commit comments

Comments
 (0)