[3/3] mipsn32: Call exit on return from fn in __clone

Submitted by Segev Finer on Aug. 15, 2018, 5:46 p.m.

Details

Message ID 20180815174620.10752-4-segev208@gmail.com
State New
Series "mips{,64,n32}: Call exit on return from fn in __clone"
Headers show

Commit Message

Segev Finer Aug. 15, 2018, 5:46 p.m.
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.
---
 src/thread/mipsn32/clone.s | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/src/thread/mipsn32/clone.s b/src/thread/mipsn32/clone.s
index 51035852..ebf5dbea 100644
--- a/src/thread/mipsn32/clone.s
+++ b/src/thread/mipsn32/clone.s
@@ -26,5 +26,8 @@  __clone:
 	nop
 1:	lw	$25, 0($sp)	# function pointer
 	lw	$4, 4($sp)	# argument pointer
-	jr	$25		# call the user's function
+	jalr	$25		# call the user's function
 	nop
+	move 	$4, $2
+	li	$2, 6058
+	syscall