|
|
1.1 root 1: /***
2: *setjmp.h - definitions/declarations for setjmp/longjmp routines
3: *
1.1.1.4 root 4: * Copyright (c) 1985-1993, Microsoft Corporation. All rights reserved.
1.1 root 5: *
6: *Purpose:
7: * This file defines the machine-dependent buffer used by
8: * setjmp/longjmp to save and restore the program state, and
9: * declarations for those routines.
10: * [ANSI/System V]
11: *
1.1.1.3 root 12: ****/
1.1 root 13:
14: #ifndef _INC_SETJMP
15:
1.1.1.4 root 16: #ifdef __cplusplus
17: extern "C" {
18: #endif
1.1 root 19:
20:
1.1.1.3 root 21: /*
22: * Conditional macro definition for function calling type and variable type
23: * qualifiers.
24: */
25: #if ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
26:
27: /*
28: * Definitions for MS C8-32 (386/486) compiler
29: */
30: #define _CRTAPI1 __cdecl
31: #define _CRTAPI2 __cdecl
32:
33: #else
34:
35: /*
36: * Other compilers (e.g., MIPS)
37: */
38: #define _CRTAPI1
39: #define _CRTAPI2
40:
1.1.1.2 root 41: #endif
1.1 root 42:
43:
44:
45:
1.1.1.3 root 46: /*
47: * Definitions specific to particular setjmp implementations.
48: */
49: #ifdef _M_IX86
1.1 root 50:
1.1.1.3 root 51: /*
52: * MS C8-32 or older MS C6-386 compilers
53: */
1.1.1.4 root 54: #ifndef _INC_SETJMPEX
1.1.1.3 root 55: #define setjmp _setjmp
1.1.1.4 root 56: #endif
1.1.1.2 root 57: #define _JBLEN 8
1.1.1.4 root 58: #define _JBTYPE int
1.1.1.2 root 59:
1.1 root 60: /*
1.1.1.4 root 61: * Define jump buffer layout for x86 setjmp/longjmp.
1.1 root 62: */
1.1.1.4 root 63:
64: typedef struct __JUMP_BUFFER {
65: unsigned long Ebp;
66: unsigned long Ebx;
67: unsigned long Edi;
68: unsigned long Esi;
69: unsigned long Esp;
70: unsigned long Eip;
71: unsigned long Registration;
72: unsigned long TryLevel;
73: } _JUMP_BUFFER;
1.1.1.3 root 74:
1.1.1.2 root 75: #else
1.1.1.4 root 76:
1.1.1.3 root 77: /*
78: * Assume compiler implements setjmp as a function
79: */
80: #define _setjmp setjmp
1.1 root 81:
1.1.1.2 root 82: #endif
1.1.1.4 root 83:
84:
85: #if defined(_M_MRX000) || defined(_MIPS_)
86: /*
87: * All MIPS implementations need _JBLEN of 16
88: */
89: #define _JBLEN 16
90: #define _JBTYPE double
91:
92: /*
93: * Define jump buffer layout for MIPS setjmp/longjmp.
94: */
95:
96: typedef struct __JUMP_BUFFER {
97: unsigned long FltF20;
98: unsigned long FltF21;
99: unsigned long FltF22;
100: unsigned long FltF23;
101: unsigned long FltF24;
102: unsigned long FltF25;
103: unsigned long FltF26;
104: unsigned long FltF27;
105: unsigned long FltF28;
106: unsigned long FltF29;
107: unsigned long FltF30;
108: unsigned long FltF31;
109: unsigned long IntS0;
110: unsigned long IntS1;
111: unsigned long IntS2;
112: unsigned long IntS3;
113: unsigned long IntS4;
114: unsigned long IntS5;
115: unsigned long IntS6;
116: unsigned long IntS7;
117: unsigned long IntS8;
118: unsigned long IntSp;
119: unsigned long Type;
120: unsigned long Fir;
121: } _JUMP_BUFFER;
122:
1.1.1.3 root 123: #endif
124:
1.1.1.5 ! root 125:
1.1.1.4 root 126: #if defined(_ALPHA_)
1.1.1.3 root 127:
128: /*
1.1.1.5 ! root 129: * The Alpha C8/GEM C compiler uses an intrinsic _setjmp.
! 130: * The Alpha acc compiler implements setjmp as a function.
! 131: */
! 132:
! 133: #ifdef _MSC_VER
! 134: #ifndef _INC_SETJMPEX
! 135: #undef _setjmp
! 136: #define setjmp _setjmp
! 137: #endif
! 138: #endif
! 139:
! 140: /*
! 141: * Alpha implementations use a _JBLEN of 24 quadwords.
! 142: * A double is used only to obtain quadword size and alignment.
1.1.1.3 root 143: */
1.1.1.4 root 144:
1.1.1.5 ! root 145: #define _JBLEN 24
1.1.1.4 root 146: #define _JBTYPE double
1.1 root 147:
1.1.1.5 ! root 148: /*
! 149: * Define jump buffer layout for Alpha setjmp/longjmp.
! 150: * A double is used only to obtain quadword size and alignment.
! 151: */
1.1 root 152:
1.1.1.5 ! root 153: typedef struct __JUMP_BUFFER {
! 154: unsigned long Fp;
! 155: unsigned long Pc;
! 156: unsigned long Seb;
! 157: unsigned long Type;
! 158: double FltF2;
! 159: double FltF3;
! 160: double FltF4;
! 161: double FltF5;
! 162: double FltF6;
! 163: double FltF7;
! 164: double FltF8;
! 165: double FltF9;
! 166: double IntS0;
! 167: double IntS1;
! 168: double IntS2;
! 169: double IntS3;
! 170: double IntS4;
! 171: double IntS5;
! 172: double IntS6;
! 173: double IntSp;
! 174: double Fir;
! 175: double Fill[5];
! 176: } _JUMP_BUFFER;
1.1 root 177:
1.1.1.5 ! root 178: #endif
1.1 root 179:
1.1.1.2 root 180:
181: /* define the buffer type for holding the state information */
182:
183: #ifndef _JMP_BUF_DEFINED
1.1.1.4 root 184: typedef _JBTYPE jmp_buf[_JBLEN];
1.1.1.2 root 185: #define _JMP_BUF_DEFINED
186: #endif
187:
188:
1.1 root 189: /* function prototypes */
190:
1.1.1.4 root 191: int _CRTAPI1 setjmp(jmp_buf);
1.1.1.3 root 192: void _CRTAPI1 longjmp(jmp_buf, int);
1.1 root 193:
1.1.1.4 root 194: #ifdef __cplusplus
195: }
196: #endif
1.1 root 197:
198: #define _INC_SETJMP
199: #endif /* _INC_SETJMP */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.