提交 8b2b61e0 编写于 作者: S Segev Finer 提交者: Rich Felker

mips archs: fix runaway execution if start fn passed to clone returns

Call SYS_exit on return from fn in __clone. This is the expected
behavior of this function. Without this the child task will crash on
return from fn, since it will return to nowhere.
上级 91e1e29d
...@@ -28,5 +28,8 @@ __clone: ...@@ -28,5 +28,8 @@ __clone:
nop nop
1: lw $25, 0($sp) 1: lw $25, 0($sp)
lw $4, 4($sp) lw $4, 4($sp)
jr $25 jalr $25
nop nop
move $4, $2
li $2, 4001
syscall
...@@ -26,5 +26,8 @@ __clone: ...@@ -26,5 +26,8 @@ __clone:
nop nop
1: ld $25, 0($sp) # function pointer 1: ld $25, 0($sp) # function pointer
ld $4, 8($sp) # argument pointer ld $4, 8($sp) # argument pointer
jr $25 # call the user's function jalr $25 # call the user's function
nop nop
move $4, $2
li $2, 5058
syscall
...@@ -26,5 +26,8 @@ __clone: ...@@ -26,5 +26,8 @@ __clone:
nop nop
1: lw $25, 0($sp) # function pointer 1: lw $25, 0($sp) # function pointer
lw $4, 4($sp) # argument pointer lw $4, 4($sp) # argument pointer
jr $25 # call the user's function jalr $25 # call the user's function
nop nop
move $4, $2
li $2, 6058
syscall
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册