home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mitsch75.zip / scheme-7_5_17-src.zip / scheme-7.5.17 / src / microcode / default.h < prev    next >
C/C++ Source or Header  |  2000-12-05  |  5KB  |  214 lines

  1. /* -*-C-*-
  2.  
  3. $Id: default.h,v 9.44 2000/12/05 21:23:44 cph Exp $
  4.  
  5. Copyright (c) 1988-2000 Massachusetts Institute of Technology
  6.  
  7. This program is free software; you can redistribute it and/or modify
  8. it under the terms of the GNU General Public License as published by
  9. the Free Software Foundation; either version 2 of the License, or (at
  10. your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful, but
  13. WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15. General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21.  
  22. /* This file contains default definitions for some hooks which
  23.    various machines require.  These machines define these hooks
  24.    in CONFIG.H and this file defines them only if they remain
  25.    undefined. */
  26.  
  27. /* Compiler bug fixes. */
  28.  
  29. #ifndef And2
  30. #define And2(x, y)    ((x) && (y))
  31. #define And3(x, y, z) ((x) && (y) && (z))
  32. #define Or2(x, y)     ((x) || (y))
  33. #define Or3(x, y, z)  ((x) || (y) || (z))
  34. #endif
  35.  
  36. #ifndef MEMORY_FETCH
  37. /* These definitions allow a true multi-processor with shared memory
  38.    but no atomic longword operations (Butterfly and Concert,
  39.    for example) to supply their own atomic operators in config.h. */
  40. #define MEMORY_FETCH(locative) (locative)
  41. #define MEMORY_STORE(locative, object) (locative) = (object)
  42. #endif
  43.  
  44. #ifndef Get_Fixed_Obj_Slot
  45. #define Get_Fixed_Obj_Slot(N)    FAST_VECTOR_REF (Fixed_Objects, N)
  46. #define Set_Fixed_Obj_Slot(N,S)    FAST_VECTOR_SET (Fixed_Objects, N, S)
  47. #define Update_FObj_Slot(N, S)  Set_Fixed_Obj_Slot(N, S)
  48. #define Declare_Fixed_Objects()    SCHEME_OBJECT Fixed_Objects
  49. #define Valid_Fixed_Obj_Vector() (VECTOR_P (Fixed_Objects))
  50. #define Save_Fixed_Obj(Save_FO)                    \
  51.   Save_FO = Fixed_Objects;                    \
  52.   Fixed_Objects = SHARP_F;
  53. #define Restore_Fixed_Obj(Save_FO)                \
  54.   Fixed_Objects = Save_FO
  55. #endif
  56.  
  57. /* Atomic swapping hook.  Used extensively. */
  58.  
  59. #ifndef SWAP_POINTERS
  60. #define SWAP_POINTERS(locative, object, target) do            \
  61. {                                    \
  62.   (target) = (* (locative));                        \
  63.   (* (locative)) = (object);                        \
  64. } while (0)
  65. #endif
  66.  
  67. #ifndef INITIALIZE_STACK
  68. #define INITIALIZE_STACK() do                        \
  69. {                                    \
  70.   Stack_Pointer = Stack_Top;                        \
  71.   SET_STACK_GUARD (Stack_Bottom + STACK_GUARD_SIZE);            \
  72.   * Stack_Bottom                            \
  73.     = (MAKE_POINTER_OBJECT (TC_BROKEN_HEART, Stack_Bottom));        \
  74. } while (0)
  75. #endif
  76.  
  77. #ifndef STACK_ALLOCATION_SIZE
  78. #define STACK_ALLOCATION_SIZE(Stack_Blocks) (Stack_Blocks)
  79. #endif
  80.  
  81. #ifndef STACK_OVERFLOWED_P
  82. #define STACK_OVERFLOWED_P()                        \
  83.   ((* Stack_Bottom) != (MAKE_POINTER_OBJECT (TC_BROKEN_HEART, Stack_Bottom)))
  84. #endif
  85.  
  86. #ifndef STACK_SANITY_CHECK
  87. #define STACK_SANITY_CHECK(name) do                    \
  88. {                                    \
  89.   extern void EXFUN (stack_death, (CONST char *));            \
  90.                                     \
  91.   if (STACK_OVERFLOWED_P ())                        \
  92.     stack_death (name);                            \
  93.     /*NOTREACHED */                            \
  94. } while (0)
  95. #endif
  96.  
  97. #ifndef SET_CONSTANT_TOP
  98. #define SET_CONSTANT_TOP() do                        \
  99. {                                    \
  100.   ALIGN_FLOAT (Free_Constant);                        \
  101.   SEAL_CONSTANT_SPACE ();                        \
  102. } while (0)
  103. #endif
  104.  
  105. #ifndef TEST_CONSTANT_TOP
  106. #define TEST_CONSTANT_TOP(New_Top) ((New_Top) <= Constant_Top)
  107. #endif
  108.  
  109. #ifndef CONSTANT_AREA_END
  110. #define CONSTANT_AREA_END()    Free_Constant
  111. #endif
  112.  
  113. #ifndef CONSTANT_AREA_START
  114. #define CONSTANT_AREA_START()    Stack_Pointer
  115. #endif /* CONSTANT_AREA_START */
  116.  
  117. #ifndef SEAL_CONSTANT_SPACE
  118. #define SEAL_CONSTANT_SPACE() do                    \
  119. {                                    \
  120.   * Free_Constant =                            \
  121.     (MAKE_POINTER_OBJECT (TC_BROKEN_HEART, Free_Constant));        \
  122. } while (0)
  123. #endif
  124.  
  125. /* Used in debug.c */
  126.  
  127. #ifndef Back_Trace_Entry_Hook
  128. #define Back_Trace_Entry_Hook()
  129. #endif
  130.  
  131. #ifndef Back_Trace_Exit_Hook
  132. #define Back_Trace_Exit_Hook()
  133. #endif
  134.  
  135. /* Used in extern.h */
  136.  
  137. #ifndef More_Debug_Flag_Externs
  138. #define More_Debug_Flag_Externs()
  139. #endif
  140.  
  141. /* Used in fasdump.c */
  142.  
  143. #ifndef Band_Dump_Permitted
  144. #define Band_Dump_Permitted()
  145. #endif
  146.  
  147. #ifndef Band_Load_Hook
  148. #define Band_Load_Hook()
  149. #endif
  150.  
  151. #ifndef Band_Dump_Exit_Hook
  152. #define Band_Dump_Exit_Hook()
  153. #endif
  154.  
  155. #ifndef Fasdump_Exit_Hook
  156. #define Fasdump_Exit_Hook()
  157. #endif
  158.  
  159. #ifndef Fasdump_Free_Calc
  160. #define Fasdump_Free_Calc(NewFree, NewMemtop) do            \
  161. {                                    \
  162.   NewFree = Unused_Heap_Bottom;                        \
  163.   NewMemTop = Unused_Heap_Top;                        \
  164. } while (0)
  165. #endif
  166.  
  167. /* Used in interpret.c */
  168.  
  169. #ifndef Eval_Ucode_Hook
  170. #define Eval_Ucode_Hook()
  171. #endif
  172.  
  173. #ifndef Pop_Return_Ucode_Hook
  174. #define Pop_Return_Ucode_Hook()
  175. #endif
  176.  
  177. #ifndef Apply_Ucode_Hook
  178. #define Apply_Ucode_Hook()
  179. #endif
  180.  
  181. #ifndef End_GC_Hook
  182. #define End_GC_Hook()
  183. #endif
  184.  
  185. /* Used in storage.c */
  186.  
  187. #ifndef More_Debug_Flag_Allocs
  188. #define More_Debug_Flag_Allocs()
  189. #endif
  190.  
  191. /* Used in utils.c */
  192.  
  193. #ifndef Global_Interrupt_Hook
  194. #define Global_Interrupt_Hook()
  195. #endif
  196.  
  197. #ifndef Error_Exit_Hook
  198. #define Error_Exit_Hook()
  199. #endif
  200.  
  201. /* Common Lisp Hooks */
  202.  
  203. #ifndef SITE_EXPRESSION_DISPATCH_HOOK
  204. #define SITE_EXPRESSION_DISPATCH_HOOK()
  205. #endif
  206.  
  207. #ifndef SITE_RETURN_DISPATCH_HOOK
  208. #define SITE_RETURN_DISPATCH_HOOK()
  209. #endif
  210.  
  211. #ifndef FASLOAD_RELOCATE_HOOK
  212. #define FASLOAD_RELOCATE_HOOK(heap_low, heap_high, constant_low, constant_high)
  213. #endif
  214.