Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

211 lines
3.9 KiB

  1. /***
  2. *setjmp.h - definitions/declarations for setjmp/longjmp routines
  3. *
  4. * Copyright (c) 1985-1994, Microsoft Corporation. All rights reserved.
  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. *
  12. ****/
  13. #ifndef _INC_SETJMP
  14. #define _INC_SETJMP
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  19. #ifndef _CRTAPI1
  20. #if ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
  21. #define _CRTAPI1 __cdecl
  22. #else
  23. #define _CRTAPI1
  24. #endif
  25. #endif
  26. /* Define _CRTAPI2 (for compatibility with the NT SDK) */
  27. #ifndef _CRTAPI2
  28. #if ( (_MSC_VER >= 800) && (_M_IX86 >= 300) )
  29. #define _CRTAPI2 __cdecl
  30. #else
  31. #define _CRTAPI2
  32. #endif
  33. #endif
  34. /* Define _CRTIMP */
  35. #ifndef _CRTIMP
  36. #ifdef _NTSDK
  37. /* definition compatible with NT SDK */
  38. #define _CRTIMP
  39. #else /* ndef _NTSDK */
  40. /* current definition */
  41. #ifdef _DLL
  42. #define _CRTIMP __declspec(dllimport)
  43. #else /* ndef _DLL */
  44. #define _CRTIMP
  45. #endif /* _DLL */
  46. #endif /* _NTSDK */
  47. #endif /* _CRTIMP */
  48. /* Define __cdecl for non-Microsoft compilers */
  49. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  50. #define __cdecl
  51. #endif
  52. /*
  53. * Definitions specific to particular setjmp implementations.
  54. */
  55. #if defined(_M_IX86)
  56. /*
  57. * MS compiler for x86
  58. */
  59. #ifndef _INC_SETJMPEX
  60. #define setjmp _setjmp
  61. #endif
  62. #define _JBLEN 16
  63. #define _JBTYPE int
  64. /*
  65. * Define jump buffer layout for x86 setjmp/longjmp.
  66. */
  67. typedef struct __JUMP_BUFFER {
  68. unsigned long Ebp;
  69. unsigned long Ebx;
  70. unsigned long Edi;
  71. unsigned long Esi;
  72. unsigned long Esp;
  73. unsigned long Eip;
  74. unsigned long Registration;
  75. unsigned long TryLevel;
  76. unsigned long Cookie;
  77. unsigned long UnwindFunc;
  78. unsigned long UnwindData[6];
  79. } _JUMP_BUFFER;
  80. #elif defined(_M_MRX000)
  81. /*
  82. * All MIPS implementations need _JBLEN of 16
  83. */
  84. #define _JBLEN 16
  85. #define _JBTYPE double
  86. /*
  87. * Define jump buffer layout for MIPS setjmp/longjmp.
  88. */
  89. typedef struct __JUMP_BUFFER {
  90. unsigned long FltF20;
  91. unsigned long FltF21;
  92. unsigned long FltF22;
  93. unsigned long FltF23;
  94. unsigned long FltF24;
  95. unsigned long FltF25;
  96. unsigned long FltF26;
  97. unsigned long FltF27;
  98. unsigned long FltF28;
  99. unsigned long FltF29;
  100. unsigned long FltF30;
  101. unsigned long FltF31;
  102. unsigned long IntS0;
  103. unsigned long IntS1;
  104. unsigned long IntS2;
  105. unsigned long IntS3;
  106. unsigned long IntS4;
  107. unsigned long IntS5;
  108. unsigned long IntS6;
  109. unsigned long IntS7;
  110. unsigned long IntS8;
  111. unsigned long IntSp;
  112. unsigned long Type;
  113. unsigned long Fir;
  114. } _JUMP_BUFFER;
  115. #elif defined(_M_ALPHA)
  116. /*
  117. * The Alpha C8/GEM C compiler uses an intrinsic _setjmp.
  118. * The Alpha acc compiler implements setjmp as a function.
  119. */
  120. #ifdef _MSC_VER
  121. #ifndef _INC_SETJMPEX
  122. #define setjmp _setjmp
  123. #endif
  124. #endif
  125. /*
  126. * Alpha implementations use a _JBLEN of 24 quadwords.
  127. * A double is used only to obtain quadword size and alignment.
  128. */
  129. #define _JBLEN 24
  130. #define _JBTYPE double
  131. /*
  132. * Define jump buffer layout for Alpha setjmp/longjmp.
  133. * A double is used only to obtain quadword size and alignment.
  134. */
  135. typedef struct __JUMP_BUFFER {
  136. unsigned long Fp;
  137. unsigned long Pc;
  138. unsigned long Seb;
  139. unsigned long Type;
  140. double FltF2;
  141. double FltF3;
  142. double FltF4;
  143. double FltF5;
  144. double FltF6;
  145. double FltF7;
  146. double FltF8;
  147. double FltF9;
  148. double IntS0;
  149. double IntS1;
  150. double IntS2;
  151. double IntS3;
  152. double IntS4;
  153. double IntS5;
  154. double IntS6;
  155. double IntSp;
  156. double Fir;
  157. double Fill[5];
  158. } _JUMP_BUFFER;
  159. #endif
  160. /* Define the buffer type for holding the state information */
  161. #ifndef _JMP_BUF_DEFINED
  162. typedef _JBTYPE jmp_buf[_JBLEN];
  163. #define _JMP_BUF_DEFINED
  164. #endif
  165. /* Function prototypes */
  166. int __cdecl setjmp(jmp_buf);
  167. _CRTIMP void __cdecl longjmp(jmp_buf, int);
  168. #ifdef __cplusplus
  169. }
  170. #endif
  171. #endif /* _INC_SETJMP */