Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/newlib
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2023-10-06 08:29:05 +0300
committerSebastian Huber <sebastian.huber@embedded-brains.de>2023-10-12 18:04:38 +0300
commitfbc5496e40eeb6d0d2ae2a3bf90182e2a9cd74f0 (patch)
tree87e3ed1e7d71439325322911f61343be5099b4d3 /newlib
parent696c282cf32b478b4e11bd8af23663aa99156cb3 (diff)
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')
-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 613df2ba2..d7185be4c 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 */