setjmp.h (104505) | setjmp.h (106755) |
---|---|
1/*- 2 * Copyright (c) 2000 3 * Intel Corporation. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 22 unchanged lines hidden (view full) --- 31 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 37 * THE POSSIBILITY OF SUCH DAMAGE. 38 * | 1/*- 2 * Copyright (c) 2000 3 * Intel Corporation. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 22 unchanged lines hidden (view full) --- 31 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 37 * THE POSSIBILITY OF SUCH DAMAGE. 38 * |
39 * $FreeBSD: head/sys/ia64/include/setjmp.h 104505 2002-10-05 05:47:56Z mike $ | 39 * $FreeBSD: head/sys/ia64/include/setjmp.h 106755 2002-11-11 08:11:44Z marcel $ |
40 */ 41 42#ifndef _MACHINE_SETJMP_H_ 43#define _MACHINE_SETJMP_H_ 44 45#include <sys/cdefs.h> 46 | 40 */ 41 42#ifndef _MACHINE_SETJMP_H_ 43#define _MACHINE_SETJMP_H_ 44 45#include <sys/cdefs.h> 46 |
47/* 48 * IA64 assembler doesn't like C style comments. This also means we can't 49 * include other include files to get things like the roundup2() macro. 50 * 51 * NOTE: Actual register storage must start on a 16 byte boundary. Both 52 * setjmp and longjmp make that adjustment before referencing the contents 53 * of jmp_buf. The macro JMPBUF_ADDR_OF() allows someone to get the address 54 * of an individual item saved in jmp_buf. 55 */ 56 | |
57#if __BSD_VISIBLE | 47#if __BSD_VISIBLE |
58#define our_roundup(x, y) (((x)+((y)-1))&(~((y)-1))) 59#endif | 48#define JMPBUF_ADDR_OF(buf, item) ((unsigned long)((char *)buf + item)) |
60 | 49 |
61#define _JMPBUF_ALIGNMENT 0x10 62 63#if __BSD_VISIBLE 64#define JMPBUF_ALIGNMENT _JMPBUF_ALIGNMENT 65#define JMPBUF_ADDR_OF(buf, item) \ 66 ((size_t)((our_roundup((size_t)buf, JMPBUF_ALIGNMENT)) + item)) 67 | |
68#define J_UNAT 0 69#define J_NATS 0x8 70#define J_PFS 0x10 71#define J_BSP 0x18 72#define J_RNAT 0x20 73#define J_PREDS 0x28 74#define J_LC 0x30 75#define J_R4 0x38 --- 28 unchanged lines hidden (view full) --- 104#define J_B3 0x1c0 105#define J_B4 0x1c8 106#define J_B5 0x1d0 107#define J_SIG0 0x1d8 108#define J_SIG1 0x1e0 109#define J_SIGMASK 0x1e8 110#endif /* __BSD_VISIBLE */ 111 | 50#define J_UNAT 0 51#define J_NATS 0x8 52#define J_PFS 0x10 53#define J_BSP 0x18 54#define J_RNAT 0x20 55#define J_PREDS 0x28 56#define J_LC 0x30 57#define J_R4 0x38 --- 28 unchanged lines hidden (view full) --- 86#define J_B3 0x1c0 87#define J_B4 0x1c8 88#define J_B5 0x1d0 89#define J_SIG0 0x1d8 90#define J_SIG1 0x1e0 91#define J_SIGMASK 0x1e8 92#endif /* __BSD_VISIBLE */ 93 |
112#define _J_END 0x1f0 113#if __BSD_VISIBLE 114#define J_END _J_END 115#endif | 94/* 95 * We have 16 bytes left for future use, but it's a nice round, 96 * but above all large number. Size is in bytes. 97 */ 98#define _JMPBUFSZ 0x200 |
116 117/* 118 * XXX this check is wrong, since LOCORE is in the application namespace and 119 * applications shouldn't be able to affect the implementation. One workaround 120 * would be to only check LOCORE if _KERNEL is defined, but unfortunately 121 * LOCORE is used outside of the kernel. The best solution would be to rename 122 * LOCORE to _LOCORE, so that it can be used in userland to safely affect the 123 * implementation. 124 */ 125#ifndef LOCORE | 99 100/* 101 * XXX this check is wrong, since LOCORE is in the application namespace and 102 * applications shouldn't be able to affect the implementation. One workaround 103 * would be to only check LOCORE if _KERNEL is defined, but unfortunately 104 * LOCORE is used outside of the kernel. The best solution would be to rename 105 * LOCORE to _LOCORE, so that it can be used in userland to safely affect the 106 * implementation. 107 */ 108#ifndef LOCORE |
109 |
|
126/* 127 * jmp_buf and sigjmp_buf are encapsulated in different structs to force 128 * compile-time diagnostics for mismatches. The structs are the same 129 * internally to avoid some run-time errors for mismatches. 130 */ 131#if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE | 110/* 111 * jmp_buf and sigjmp_buf are encapsulated in different structs to force 112 * compile-time diagnostics for mismatches. The structs are the same 113 * internally to avoid some run-time errors for mismatches. 114 */ 115#if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE |
132typedef struct _sigjmp_buf { 133 char _Buffer[_J_END + _JMPBUF_ALIGNMENT]; 134} sigjmp_buf[1]; | 116struct _sigjmp_buf { 117 char _Buffer[_JMPBUFSZ]; 118} __aligned(16); 119typedef struct _sigjmp_buf sigjmp_buf[1]; |
135#endif 136 | 120#endif 121 |
137typedef struct _jmp_buf { 138 char _Buffer[ _J_END + _JMPBUF_ALIGNMENT ]; 139} jmp_buf[1]; 140#endif | 122struct _jmp_buf { 123 char _Buffer[_JMPBUFSZ]; 124} __aligned(16); 125typedef struct _jmp_buf jmp_buf[1]; |
141 | 126 |
127#endif /* !LOCORE */ 128 |
|
142#endif /* !_MACHINE_SETJMP_H_ */ | 129#endif /* !_MACHINE_SETJMP_H_ */ |