File tree Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,21 @@ longjmp:
170
170
vmsr fpscr , r2 / * Restore the FPSCR * /
171
171
#endif / * CONFIG_ARCH_FPU * /
172
172
173
- mov r0 , r1 / * return val * /
173
+ / * Check and substitute the given return value to 1 if it's 0 * /
174
+
175
+ movs r0 , r1
176
+ #ifdef CONFIG_ARCH_ARMV6M
177
+ / * ARMv6 - M only supports branching with condition
178
+ * So we fall back to not use IT blocks in th at case
179
+ * /
180
+
181
+ bne 1f
182
+ movs r0 , # 1
183
+ 1 :
184
+ #else
185
+ it eq
186
+ moveq r0 , # 1
187
+ #endif
174
188
bx lr
175
189
176
190
.size longjmp , . - longjmp
Original file line number Diff line number Diff line change @@ -85,9 +85,11 @@ SYMBOL(setjmp):
85
85
SYMBOL(longjmp):
86
86
movl 4 (%esp ), %ecx /* jmpbuf in %ecx. */
87
87
movl 8 (%esp ), %eax /* Second argument is return value. */
88
-
88
+ testl %eax , %eax
89
+ jnz 1f
90
+ incl %eax
89
91
/* Save the return address now. */
90
-
92
+ 1:
91
93
movl (JB_PC)(%ecx ), %edx
92
94
93
95
/* Restore registers. */
Original file line number Diff line number Diff line change @@ -130,9 +130,12 @@ SYMBOL(longjmp):
130
130
/* Setup return value */
131
131
132
132
movl %esi ,%eax
133
+ testl %eax ,%eax
134
+ jnz 1f
135
+ incl %eax
133
136
134
137
/* Restore registers */
135
-
138
+ 1:
136
139
movq JB_RBX(REGS),%rbx /* Load 1: rbx */
137
140
movq JB_RSP(REGS),%rsp /* Load 2: rsp */
138
141
movq JB_RBP(REGS),%rbp /* Load 3: rdi */
You can’t perform that action at this time.
0 commit comments