Skip to content

Commit 111f04a

Browse files
peng1 chennashif
authored andcommitted
arc/swap: add operation to save register r0 value.
when enable tracing, the register r0 which saves the return value of __swap will be changed by sys_trace_thread_switched_in function, casuing some unexpected return value, so use the stack to save register r0 value. Signed-off-by: peng1 chen <[email protected]>
1 parent e2835e2 commit 111f04a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/arc/core/swap.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,11 @@ return_loc:
179179
#ifdef CONFIG_TRACING
180180
push_s blink
181181
push_s r1
182+
push_s r0
182183

183184
bl sys_trace_thread_switched_in
184185

186+
pop_s r0
185187
pop_s r1
186188
pop_s blink
187189
#endif

0 commit comments

Comments
 (0)