Path: blob/main/sys/contrib/openzfs/module/lua/setjmp/setjmp_sparc64.S
48534 views
// SPDX-License-Identifier: BSD-3-Clause1/*2* Copyright (c) 1992, 19933* The Regents of the University of California. All rights reserved.4*5* This software was developed by the Computer Systems Engineering group6* at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and7* contributed to Berkeley.8*9* Redistribution and use in source and binary forms, with or without10* modification, are permitted provided that the following conditions11* are met:12* 1. Redistributions of source code must retain the above copyright13* notice, this list of conditions and the following disclaimer.14* 2. Redistributions in binary form must reproduce the above copyright15* notice, this list of conditions and the following disclaimer in the16* documentation and/or other materials provided with the distribution.17* 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 REGENTS 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 REGENTS 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*33* $Header: _setjmp.s,v 1.1 91/07/06 16:45:53 torek Exp34*/3536#if defined(LIBC_SCCS) && !defined(lint)37#if 038.asciz "@(#)_setjmp.s 8.1 (Berkeley) 6/4/93"39#else40RCSID("$NetBSD: _setjmp.S,v 1.4 1998/10/08 02:27:59 eeh Exp $")41#endif42#endif /* LIBC_SCCS and not lint */4344#define _JB_FP 0x045#define _JB_PC 0x846#define _JB_SP 0x104748.register %g2,#ignore49.register %g3,#ignore5051#define ENTRY(x) \52.text ; \53.balign 32 ; \54.globl x ; \55.type x,@function ; \56x:5758#define END(x) \59.size x, . - x6061/*62* C library -- setjmp, longjmp63*64* longjmp(a,v)65* will generate a "return(v?v:1)" from66* the last call to67* setjmp(a)68* by restoring the previous context.69*/7071ENTRY(setjmp)72stx %sp, [%o0 + _JB_SP]73stx %o7, [%o0 + _JB_PC]74stx %fp, [%o0 + _JB_FP]75retl76clr %o077END(setjmp)7879ENTRY(longjmp)80mov 1, %g181movrnz %o1, %o1, %g182mov %o0, %g283ldx [%g2 + _JB_FP], %g3841: cmp %fp, %g385bl,a 1b86restore87be,a 2f88ldx [%g2 + _JB_SP], %o08990.Lbotch:91illtrap92932: cmp %o0, %sp94bge,a 3f95mov %o0, %sp96b,a .Lbotch97nop983: ldx [%g2 + _JB_PC], %o799retl100mov %g1, %o0101END(longjmp)102103#ifdef __ELF__104.section .note.GNU-stack,"",%progbits105#endif106107108