aboutsummaryrefslogtreecommitdiff
path: root/libs/libucontext/patches/010-return_values_fix.patch
blob: 43bc87d0c492051014b30c0a859a198a5a2896d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--- a/arch/arm/swapcontext.S
+++ b/arch/arm/swapcontext.S
@@ -17,10 +17,12 @@ ALIAS(__swapcontext, libucontext_swapcon
 
 FUNC(libucontext_swapcontext)
 	/* copy all of the current registers into the ucontext structure */
-	add	r2, r0, #REG_OFFSET(0)
-	stmia	r2, {r0-r12}
 	str	r13, [r0,#REG_OFFSET(13)]
 	str	r14, [r0,#REG_OFFSET(15)]
+	add	r2, r0, #REG_OFFSET(0)
+	/* copy r0 with value 0 to indicate success (return value 0) */
+	mov r0, #0
+	stmia	r2, {r0-r12}
 
 	/* load new registers from the second ucontext structure */
 	add	r14, r1, #REG_OFFSET(0)