From c16862d85b48cb1e00d3b68e8781a6822716a82f Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Mon, 6 May 2013 18:23:09 +0000 Subject: 2013-05-06 Sandra Loosemore * configure.host (machine_dir, sys_dir, syscall_dir, newlib_cflags): Add settings for nios2*. * libc/include/machine/ieeefp.h (IEEE_BIG_ENDIAN, IEEE_LITTLE_ENDIAN): Likewise. * libc/include/machine/setjmp.h (JBLEN, JBTYPE): Likewise. * libc/machine/configure.in: Add nios2 subdir. * libc/machine/configure: Regenerated. * libc/machine/nios2/Makefile.am: New. * libc/machine/nios2/Makefile.in: New (autogenerated). * libc/machine/nios2/aclocal.m4: New (copied from mips version). * libc/machine/nios2/configure.in: New. * libc/machine/nios2/configure: New (autogenerated). * libc/machine/nios2/setjmp.s: New. --- newlib/libc/machine/nios2/setjmp.s | 82 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 newlib/libc/machine/nios2/setjmp.s (limited to 'newlib/libc/machine/nios2/setjmp.s') diff --git a/newlib/libc/machine/nios2/setjmp.s b/newlib/libc/machine/nios2/setjmp.s new file mode 100644 index 000000000..1545eaba8 --- /dev/null +++ b/newlib/libc/machine/nios2/setjmp.s @@ -0,0 +1,82 @@ +;/* +; * C library -- _setjmp, _longjmp +; * +; * _longjmp(a,v) +; * will generate a "return(v?v:1)" from +; * the last call to +; * _setjmp(a) +; * by unwinding the call stack. +; * The previous signal state is NOT restored. +; * +; * +; * Copyright (c) 2003 Altera Corporation +; * All rights reserved. +; * +; * Redistribution and use in source and binary forms, with or without +; * modification, are permitted provided that the following conditions +; * are met: +; * +; * o Redistributions of source code must retain the above copyright +; * notice, this list of conditions and the following disclaimer. +; * o Redistributions in binary form must reproduce the above copyright +; * notice, this list of conditions and the following disclaimer in the +; * documentation and/or other materials provided with the distribution. +; * o Neither the name of Altera Corporation nor the names of its +; * contributors may be used to endorse or promote products derived from +; * this software without specific prior written permission. +; * +; * THIS SOFTWARE IS PROVIDED BY ALTERA CORPORATION, THE COPYRIGHT HOLDER, +; * AND ITS CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +; * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +; * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +; * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +; * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +; * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +; * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +; * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +; * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +; * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +; */ + + .section .text + .align 3 + .globl setjmp + .type setjmp,@function + .globl longjmp + .type longjmp,@function + + +setjmp: + stw r16, 0(r4) + stw r17, 4(r4) + stw r18, 8(r4) + stw r19, 12(r4) + stw r20, 16(r4) + stw r21, 20(r4) + stw r22, 24(r4) + stw r23, 28(r4) + stw gp, 32(r4) + stw sp, 36(r4) + stw fp, 40(r4) + stw ra, 44(r4) + mov r2, zero + ret + +longjmp: + ldw r16, 0(r4) + ldw r17, 4(r4) + ldw r18, 8(r4) + ldw r19, 12(r4) + ldw r20, 16(r4) + ldw r21, 20(r4) + ldw r22, 24(r4) + ldw r23, 28(r4) + ldw gp, 32(r4) + ldw sp, 36(r4) + ldw fp, 40(r4) + ldw ra, 44(r4) + mov r2, r5 + bne r2, zero, 1f + movi r2, 1 +1: + ret -- cgit v1.2.3