xref: /freebsd-src/sys/x86/include/setjmp.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1f85ac30aSTijl Coosemans /*-
2*51369649SPedro F. Giffuni  * SPDX-License-Identifier: BSD-3-Clause
3*51369649SPedro F. Giffuni  *
4f85ac30aSTijl Coosemans  * Copyright (c) 1998 John Birrell <jb@cimlogic.com.au>.
5f85ac30aSTijl Coosemans  * All rights reserved.
6f85ac30aSTijl Coosemans  *
7f85ac30aSTijl Coosemans  * Redistribution and use in source and binary forms, with or without
8f85ac30aSTijl Coosemans  * modification, are permitted provided that the following conditions
9f85ac30aSTijl Coosemans  * are met:
10f85ac30aSTijl Coosemans  * 1. Redistributions of source code must retain the above copyright
11f85ac30aSTijl Coosemans  *    notice, this list of conditions and the following disclaimer.
12f85ac30aSTijl Coosemans  * 2. Redistributions in binary form must reproduce the above copyright
13f85ac30aSTijl Coosemans  *    notice, this list of conditions and the following disclaimer in the
14f85ac30aSTijl Coosemans  *    documentation and/or other materials provided with the distribution.
15f85ac30aSTijl Coosemans  * 3. Neither the name of the author nor the names of any co-contributors
16f85ac30aSTijl Coosemans  *    may be used to endorse or promote products derived from this software
17f85ac30aSTijl Coosemans  *    without specific prior written permission.
18f85ac30aSTijl Coosemans  *
19f85ac30aSTijl Coosemans  * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND
20f85ac30aSTijl Coosemans  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21f85ac30aSTijl Coosemans  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22f85ac30aSTijl Coosemans  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23f85ac30aSTijl Coosemans  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24f85ac30aSTijl Coosemans  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25f85ac30aSTijl Coosemans  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26f85ac30aSTijl Coosemans  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27f85ac30aSTijl Coosemans  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28f85ac30aSTijl Coosemans  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29f85ac30aSTijl Coosemans  * SUCH DAMAGE.
30f85ac30aSTijl Coosemans  */
31f85ac30aSTijl Coosemans 
32f85ac30aSTijl Coosemans #ifndef _MACHINE_SETJMP_H_
33f85ac30aSTijl Coosemans #define	_MACHINE_SETJMP_H_
34f85ac30aSTijl Coosemans 
35f85ac30aSTijl Coosemans #include <sys/cdefs.h>
36f85ac30aSTijl Coosemans 
37f85ac30aSTijl Coosemans #define	_JBLEN	12		/* Size of the jmp_buf on AMD64. */
38f85ac30aSTijl Coosemans 
39f85ac30aSTijl Coosemans /*
40f85ac30aSTijl Coosemans  * jmp_buf and sigjmp_buf are encapsulated in different structs to force
41f85ac30aSTijl Coosemans  * compile-time diagnostics for mismatches.  The structs are the same
42f85ac30aSTijl Coosemans  * internally to avoid some run-time errors for mismatches.
43f85ac30aSTijl Coosemans  */
44f85ac30aSTijl Coosemans #if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE
45f85ac30aSTijl Coosemans typedef	struct _sigjmp_buf { long _sjb[_JBLEN]; } sigjmp_buf[1];
46f85ac30aSTijl Coosemans #endif
47f85ac30aSTijl Coosemans 
48f85ac30aSTijl Coosemans typedef	struct _jmp_buf { long _jb[_JBLEN]; } jmp_buf[1];
49f85ac30aSTijl Coosemans 
50f85ac30aSTijl Coosemans #endif /* !_MACHINE_SETJMP_H_ */
51