summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/nios2/__longjmp.S
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-07-16 11:09:34 +0000
committerEric Andersen <andersen@codepoet.org>2004-07-16 11:09:34 +0000
commitc3d50a69839f8d80fc7244fde6e4a57e5e39dd36 (patch)
treec9e27baac7541384b806cce0845f28c1f59b5a2e /libc/sysdeps/linux/nios2/__longjmp.S
parent3cf731bf40f153a73373798085d1f45a80b972d6 (diff)
Pete Popov writes:
Hi Erik, I'm not sure why the NIOS support is not in uClibc -- perhaps the patch was rejected or never submitted? In any case, I'm playing with some NIOS stuff and created this patch against 0.9.26. The work was done by Microtronix. I'm not sure who else contributed to it. It would be great to have the NIOS support available in uClibc so developers don't have to go searching for these bits. Pete
Diffstat (limited to 'libc/sysdeps/linux/nios2/__longjmp.S')
-rw-r--r--libc/sysdeps/linux/nios2/__longjmp.S48
1 files changed, 48 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/nios2/__longjmp.S b/libc/sysdeps/linux/nios2/__longjmp.S
new file mode 100644
index 000000000..d15f040cd
--- /dev/null
+++ b/libc/sysdeps/linux/nios2/__longjmp.S
@@ -0,0 +1,48 @@
+/*
+ * libc/sysdeps/linux/nios2/__longjmp.S
+ *
+ * Copyright (C) 2004,05,06 Microtronix Datacom Ltd
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License. See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Wentao Xu <wentao@microtronix.com>
+ *
+ */
+
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
+.globl __longjmp
+.type __longjmp,@function
+.balign 4
+
+__longjmp:
+ /* return value is in r5*/
+ mov r2, r5
+
+ /* jmp_buf in r4, restore regs. */
+ ldw r16, (JB_REGS+ 0)(r4)
+ ldw r17, (JB_REGS+ 4)(r4)
+ ldw r18, (JB_REGS+ 8)(r4)
+ ldw r19, (JB_REGS+12)(r4)
+ ldw r20, (JB_REGS+16)(r4)
+ ldw r21, (JB_REGS+20)(r4)
+ ldw r22, (JB_REGS+24)(r4)
+ ldw r23, (JB_REGS+28)(r4)
+
+ ldw ra, JB_PC(r4)
+ ldw fp, JB_FP(r4)
+ ldw gp, JB_GP(r4)
+ ldw sp, JB_SP(r4)
+
+#if defined(__HAVE_FPU__)
+ RESTORE_FPU r4 JB_FPREGS
+#endif
+
+ /* return to saved RA */
+ ret
+
+