aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2023-10-06 07:29:05 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2023-10-12 17:04:38 +0200
commitfbc5496e40eeb6d0d2ae2a3bf90182e2a9cd74f0 (patch)
tree87e3ed1e7d71439325322911f61343be5099b4d3 /newlib/libc
parent696c282cf32b478b4e11bd8af23663aa99156cb3 (diff)
downloadnewlib-fbc5496e40eeb6d0d2ae2a3bf90182e2a9cd74f0.zip
newlib-fbc5496e40eeb6d0d2ae2a3bf90182e2a9cd74f0.tar.gz
newlib-fbc5496e40eeb6d0d2ae2a3bf90182e2a9cd74f0.tar.bz2
sparc: Improve setjmp()
Flush the windows in setjmp(). This helps if the stack is changed after the setjmp() and we want to jump back to the original stack using longjmp().
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/machine/sparc/setjmp.S2
1 files changed, 2 insertions, 0 deletions
diff --git a/newlib/libc/machine/sparc/setjmp.S b/newlib/libc/machine/sparc/setjmp.S
index 613df2b..d7185be 100644
--- a/newlib/libc/machine/sparc/setjmp.S
+++ b/newlib/libc/machine/sparc/setjmp.S
@@ -110,6 +110,8 @@
ENTRY(setjmp)
ENTRY(_setjmp)
+ ta 0x03 /* Flush registers, just in case another stack
+ is used after the setjmp(). */
st %sp, [%o0] /* caller's stack pointer */
st %i7, [%o0+4] /* caller's return pc */
st %fp, [%o0+8] /* store caller's frame pointer */