/*-1* Copyright (c) 2016 Justin Hibbits2* All rights reserved.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7* 1. Redistributions of source code must retain the above copyright8* notice, this list of conditions and the following disclaimer.9* 2. Redistributions in binary form must reproduce the above copyright10* notice, this list of conditions and the following disclaimer in the11* documentation and/or other materials provided with the distribution.12*13* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND14* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE15* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE16* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE17* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL18* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS19* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)20* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT21* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY22* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF23* SUCH DAMAGE.24*/25/* $NetBSD: _setjmp.S,v 1.1 1997/03/29 20:55:53 thorpej Exp $ */2627#include <machine/asm.h>28/*29* C library -- _setjmp, _longjmp30*31* _longjmp(a,v)32* will generate a "return(v?v:1)" from the last call to33* _setjmp(a)34* by restoring registers from the stack.35* The previous signal state is NOT restored.36*37* jmpbuf layout:38* +------------+39* | unused |40* +------------+41* | unused |42* | |43* | (4 words) |44* | |45* +------------+46* | saved regs |47* | ... |48*/4950ENTRY(_setjmp)51mflr %r1152mfcr %r1253evstdd %r1,24+0*8(%r3)54evstdd %r2,24+1*8(%r3)55evstdd %r11,24+2*8(%r3)56evstdd %r12,24+3*8(%r3)57evstdd %r13,24+4*8(%r3)58evstdd %r14,24+5*8(%r3)59evstdd %r15,24+6*8(%r3)60evstdd %r16,24+7*8(%r3)61evstdd %r17,24+8*8(%r3)62evstdd %r18,24+9*8(%r3)63evstdd %r19,24+10*8(%r3)64evstdd %r20,24+11*8(%r3)65evstdd %r21,24+12*8(%r3)66evstdd %r22,24+13*8(%r3)67evstdd %r23,24+14*8(%r3)68evstdd %r24,24+15*8(%r3)69evstdd %r25,24+16*8(%r3)70evstdd %r26,24+17*8(%r3)71evstdd %r27,24+18*8(%r3)72evstdd %r28,24+19*8(%r3)73evstdd %r29,24+20*8(%r3)74evstdd %r30,24+21*8(%r3)75evstdd %r31,24+22*8(%r3)7677li %r3,078blr79END(_setjmp)8081ENTRY(_longjmp)82evldd %r1,24+0*8(%r3)83evldd %r2,24+1*8(%r3)84evldd %r11,24+2*8(%r3)85evldd %r12,24+3*8(%r3)86evldd %r13,24+4*8(%r3)87evldd %r14,24+5*8(%r3)88evldd %r15,24+6*8(%r3)89evldd %r16,24+7*8(%r3)90evldd %r17,24+8*8(%r3)91evldd %r18,24+9*8(%r3)92evldd %r19,24+10*8(%r3)93evldd %r20,24+11*8(%r3)94evldd %r21,24+12*8(%r3)95evldd %r22,24+13*8(%r3)96evldd %r23,24+14*8(%r3)97evldd %r24,24+15*8(%r3)98evldd %r25,24+16*8(%r3)99evldd %r26,24+17*8(%r3)100evldd %r27,24+18*8(%r3)101evldd %r28,24+19*8(%r3)102evldd %r29,24+20*8(%r3)103evldd %r30,24+21*8(%r3)104evldd %r31,24+22*8(%r3)105106mtlr %r11107mtcr %r12108or. %r3,%r4,%r4109bnelr110li %r3,1111blr112END(_longjmp)113114.section .note.GNU-stack,"",%progbits115116117