Path: blob/main/sys/contrib/openzfs/module/lua/setjmp/setjmp_x86_64.S
48535 views
// SPDX-License-Identifier: CDDL-1.01/*2* CDDL HEADER START3*4* The contents of this file are subject to the terms of the5* Common Development and Distribution License (the "License").6* You may not use this file except in compliance with the License.7*8* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE9* or https://opensource.org/licenses/CDDL-1.0.10* See the License for the specific language governing permissions11* and limitations under the License.12*13* When distributing Covered Code, include this CDDL HEADER in each14* file and include the License file at usr/src/OPENSOLARIS.LICENSE.15* If applicable, add the following below this CDDL HEADER, with the16* fields enclosed by brackets "[]" replaced with your own identifying17* information: Portions Copyright [yyyy] [name of copyright owner]18*19* CDDL HEADER END20*/2122/*23* Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.24*/2526#if defined(_KERNEL) && defined(__linux__)27#include <linux/linkage.h>28#endif2930/*31* Setjmp and longjmp implement non-local gotos using state vectors32* type label_t.33*/34#ifdef __x86_64__3536#define _ASM37#include <sys/asm_linkage.h>3839ENTRY_ALIGN(setjmp, 8)40movq %rsp, 0(%rdi)41movq %rbp, 8(%rdi)42movq %rbx, 16(%rdi)43movq %r12, 24(%rdi)44movq %r13, 32(%rdi)45movq %r14, 40(%rdi)46movq %r15, 48(%rdi)47movq 0(%rsp), %rdx /* return address */48movq %rdx, 56(%rdi) /* rip */49xorl %eax, %eax /* return 0 */50RET51SET_SIZE(setjmp)5253ENTRY_ALIGN(longjmp, 8)54movq 0(%rdi), %rsp55movq 8(%rdi), %rbp56movq 16(%rdi), %rbx57movq 24(%rdi), %r1258movq 32(%rdi), %r1359movq 40(%rdi), %r1460movq 48(%rdi), %r1561movq 56(%rdi), %rdx /* return address */62movq %rdx, 0(%rsp)63xorl %eax, %eax64incl %eax /* return 1 */65RET66SET_SIZE(longjmp)6768#ifdef __ELF__69.section .note.GNU-stack,"",%progbits70#endif7172#endif /* __x86_64__ */737475