4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or https://opensource.org/licenses/CDDL-1.0.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
26 #if defined(_KERNEL) && defined(__linux__)
27 #include <linux/linkage.h>
31 * Setjmp and longjmp implement non-local gotos using state vectors
37 #include <sys/asm_linkage.h>
39 ENTRY_ALIGN(setjmp, 8)
47 movq 0(%rsp), %rdx /* return address */
48 movq %rdx, 56(%rdi) /* rip */
49 xorl %eax, %eax /* return 0 */
53 ENTRY_ALIGN(longjmp, 8)
61 movq 56(%rdi), %rdx /* return address */
64 incl %eax /* return 1 */
69 .section .note.GNU-stack,"",%progbits
72 #endif /* __x86_64__ */