/* $NetBSD: sigsetjmp.S,v 1.6 2013/04/19 16:50:22 matt Exp $ */12/*3* Copyright (c) 1997 Mark Brinicombe4* All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14* 3. All advertising materials mentioning features or use of this software15* must display the following acknowledgement:16* This product includes software developed by Mark Brinicombe17* 4. Neither the name of the University nor the names of its contributors18* may be used to endorse or promote products derived from this software19* without specific prior written permission.20*21* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND22* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE23* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE24* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE25* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL26* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS27* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)28* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT29* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY30* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF31* SUCH DAMAGE.32*/3334#include <machine/asm.h>35#include <machine/setjmp.h>3637/*38* C library -- sigsetjmp, siglongjmp39*40* longjmp(a,v)41* will generate a "return(v)" from the last call to42* setjmp(a, m)43* by restoring registers from the stack.44* The previous signal state is restored.45*/4647ENTRY(sigsetjmp)48teq r1, #049beq PIC_SYM(_C_LABEL(_setjmp), PLT)50b PIC_SYM(_C_LABEL(setjmp), PLT)51END(sigsetjmp)5253.L_setjmp_magic:54.word _JB_MAGIC__SETJMP55WEAK_ALIAS(__siglongjmp, siglongjmp)5657ENTRY(siglongjmp)58ldr r2, .L_setjmp_magic /* load magic */59ldr r3, [r0] /* get magic from jmp_buf */60bic r3, r3, #(_JB_MAGIC__SETJMP ^ _JB_MAGIC__SETJMP_VFP)61/* ignore VFP-ness of magic */62teq r2, r3 /* magic correct? */63beq PIC_SYM(_C_LABEL(_longjmp), PLT)64b PIC_SYM(_C_LABEL(longjmp), PLT)65END(siglongjmp)6667.section .note.GNU-stack,"",%progbits686970