1 /* 2 * Copyright 2004-2005, Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _SETJMP_H_ 6 #define _SETJMP_H_ 7 8 #include <signal.h> 9 10 /* include architecture specific definitions */ 11 #ifdef __INTEL__ 12 #include <arch/x86/arch_setjmp.h> 13 #elif __POWERPC__ 14 #include <arch/ppc/arch_setjmp.h> 15 #elif __M68K__ 16 #include <arch/m68k/arch_setjmp.h> 17 #elif __MIPSEL__ 18 #include <arch/mipsel/arch_setjmp.h> 19 #else 20 #error #include <arch/<cpu>/arch_setjmp.h> 21 #endif 22 23 typedef struct __jmp_buf_tag { 24 __jmp_buf regs; /* saved registers, stack & program pointer */ 25 int mask_was_saved; 26 sigset_t saved_mask; 27 } jmp_buf[1]; 28 29 typedef jmp_buf sigjmp_buf; 30 31 32 #ifdef __cplusplus 33 extern "C" { 34 #endif 35 36 extern int _setjmp(jmp_buf jumpBuffer); 37 extern int setjmp(jmp_buf jumpBuffer); 38 extern int sigsetjmp(jmp_buf jumpBuffer, int saveMask); 39 40 extern void _longjmp(jmp_buf jumpBuffer, int value); 41 extern void longjmp(jmp_buf jumpBuffer, int value); 42 extern void siglongjmp(sigjmp_buf jumpBuffer, int value); 43 44 #ifdef __cplusplus 45 } 46 #endif 47 48 #endif /* _SETJMP_H_ */ 49