Leaked source code of windows server 2003
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.

262 lines
6.2 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. config.h
  5. Abstract:
  6. This file defines the names of all configuration variables within
  7. the CPU.
  8. Author:
  9. Barry Bond (barrybo) creation-date 12-Jun-1996
  10. Revision History:
  11. --*/
  12. #ifndef _CONFIG_H_
  13. #define _CONFIG_H_
  14. //
  15. // Global definitions
  16. //
  17. #ifndef _ALPHA_
  18. #define MAX_PROLOG_SIZE 0x1000 // max size of StartTranslatedCode prolog
  19. #else
  20. #define MAX_PROLOG_SIZE 0x2000 // max size of StartTranslatedCode prolog
  21. #endif
  22. #define MAX_INSTR_COUNT 200 // max number of instructions to compile
  23. /*
  24. * The amount of memory to reserve (in bytes) for the dynamically-
  25. * allocated CPU Translation Cache. This reserve is added to the
  26. * 2MB statically-allocated cache.
  27. *
  28. * Minimum size is 1 page of memory (4096 on MIPS and PPC, 8192 on Alpha).
  29. * Default value is 2MB. (DYN_CACHE_SIZE)
  30. * Maximum size is all available memory.
  31. *
  32. */
  33. #define STR_CACHE_RESERVE L"CpuCacheReserve"
  34. extern DWORD CpuCacheReserve;
  35. /*
  36. * The amount of memory to commit (in bytes) for the dynamically-
  37. * allocated CPU Translation Cache. The 2MB statically-allocated
  38. * cache is fully committed at startup.
  39. *
  40. * Minimum size is 1 page of memory (4096 on MIPS and PPC, 8192 on Alpha).
  41. * Default value is 1 page. (MAX_PROLOG_SIZE)
  42. * Maximum size is size of reserve.
  43. *
  44. */
  45. #define STR_CACHE_COMMIT L"CpuCacheCommit"
  46. extern DWORD CpuCacheCommit;
  47. /*
  48. * If consecutive cache commits occur within the specified time, the amount
  49. * committed each time doubles. (in ms)
  50. *
  51. * Minimum value is 0
  52. * Default value is 200
  53. * Maximum value is -1
  54. *
  55. */
  56. #define STR_CACHE_GROW_TICKS L"CpuCacheGrowTicks"
  57. extern DWORD CpuCacheGrowTicks;
  58. /*
  59. * If consecutive cache commits occur past the specified time, the amount
  60. * committed each time is cut in half. (in ms)
  61. *
  62. * Minimum value is 0
  63. * Default value is 1000
  64. * Maximum value is -1
  65. *
  66. */
  67. #define STR_CACHE_SHRINK_TICKS L"CpuCacheShrinkTicks"
  68. extern DWORD CpuCacheShrinkTicks;
  69. /*
  70. * Minimum amount of memory (in bytes) to commit in the Translation Cache.
  71. * Note that this value will be rounded up to the next power of 2.
  72. *
  73. * Minimum value is 1 page
  74. * Default value is 32768
  75. * Maximum value is size of cache
  76. *
  77. */
  78. #define STR_CACHE_CHUNKMIN L"CpuCacheChunkMin"
  79. extern DWORD CpuCacheChunkMin;
  80. /*
  81. * Maximum amount of memory (in bytes) to commit in the Translation Cache.
  82. * Note that this value will be rounded up to the next power of 2.
  83. *
  84. * Minimum value is 1 page
  85. * Default value is 512k
  86. * Maximum value is size of cache
  87. *
  88. */
  89. #define STR_CACHE_CHUNKMAX L"CpuCacheChunkMax"
  90. extern DWORD CpuCacheChunkMax;
  91. /*
  92. * Initial amount of memory (in bytes) to commit in the Translation Cache.
  93. * Note that this value will be rounded up to the next power of 2.
  94. *
  95. * Minimum value is 1 page
  96. * Default value is 65536
  97. * Maximum value is size of cache
  98. *
  99. */
  100. #define STR_CACHE_CHUNKSIZE L"CpuCacheChunkSize"
  101. extern DWORD CpuCacheChunkSize;
  102. /*
  103. * Time to wait for other threads to synchronize (in ms).
  104. *
  105. * Minimum time is 0
  106. * Default time is 3 times the default time used for NT critical sections
  107. * Maximum time is -1 (infinity)
  108. *
  109. */
  110. #define STR_MRSW_TIMEOUT L"CpuTimeout"
  111. extern LARGE_INTEGER MrswTimeout;
  112. /*
  113. * Default compilation flags
  114. *
  115. * See cpu\inc\compiler.h for COMPFL_ values and meanings
  116. *
  117. * Default=COMPFL_FAST
  118. *
  119. */
  120. #define STR_COMPILERFLAGS L"CpuCompilerFlags"
  121. extern DWORD CompilerFlags;
  122. /*
  123. * Flag indicating whether winpxem.dll will be used to emulate
  124. * floating-point instructions using the Intel Windows NT 486SX
  125. * emulator instead of the Wx86 implementation.
  126. *
  127. * Default=0
  128. * Non-zero indicates winpxem.dll will be used.
  129. *
  130. */
  131. #define STR_USEWINPXEM L"CpuNoFPU"
  132. extern DWORD fUseNPXEM;
  133. /*
  134. * Number of times to retry memory allocations before failing.
  135. *
  136. * Min = 1
  137. * Default = 4
  138. * Max = 0xffffffff
  139. *
  140. */
  141. #define STR_CPU_MAX_ALLOC_RETRIES L"CpuMaxAllocRetries"
  142. extern DWORD CpuMaxAllocRetries;
  143. /*
  144. * Time to sleep between memory allocation retries (in ms).
  145. *
  146. * Min = 0
  147. * Default = 200
  148. * Max = 0xffffffff
  149. *
  150. */
  151. #define STR_CPU_WAIT_FOR_MEMORY_TIME L"CpuWaitForMemoryTime"
  152. extern DWORD CpuWaitForMemoryTime;
  153. /*
  154. * Number of instructions of lookahead in the CPU
  155. *
  156. * Min = 1
  157. * Default = 200 (MAX_INSTR_COUNT)
  158. * Max = 200 (MAX_INSTR_COUNT)
  159. *
  160. */
  161. #define STR_CPU_MAX_INSTRUCTIONS L"CpuInstructionLookahead"
  162. extern DWORD CpuInstructionLookahead;
  163. /*
  164. * Disable the Dynamic Translation Cache altogether
  165. *
  166. * Default = 0 - Dynamic Translation Cache enabled
  167. * nonzero - use only the static Translation Cache
  168. *
  169. */
  170. #define STR_CPU_DISABLE_DYNCACHE L"CpuDisableDynamicCache"
  171. extern DWORD CpuDisableDynamicCache;
  172. /*
  173. * Size of ENTRYPOINT descriptor reservation, in bytes
  174. *
  175. * Default = 0x1000000
  176. *
  177. */
  178. #define STR_CPU_ENTRYPOINT_RESERVE L"CpuEntryPointReserve"
  179. extern DWORD CpuEntryPointReserve;
  180. /*
  181. * Disable caching of x86 registers in RISC registers
  182. *
  183. * Default = 0 - x86 registers cached in RISC registers
  184. * nonzero - x86 registers accessed only from memory
  185. *
  186. */
  187. #define STR_CPU_DISABLE_REGCACHE L"CpuDisableRegCache"
  188. extern DWORD CpuDisableRegCache;
  189. /*
  190. * Disable dead x86 flag removal
  191. *
  192. * Default = 0 - dead x86 flags not computed
  193. * nonzero - x86 flags always computed
  194. *
  195. */
  196. #define STR_CPU_DISABLE_NOFLAGS L"CpuDisableNoFlags"
  197. extern DWORD CpuDisableNoFlags;
  198. /*
  199. * Disable Ebp alignment detection.
  200. *
  201. * Default = 0 - If EBP is determined to be a stack frame pointer, assume
  202. * it is an aligned pointer.
  203. * nonzero - Assume EBP is always an unaligned pointer.
  204. *
  205. */
  206. #define STR_CPU_DISABLE_EBPALIGN L"CpuDisableEbpAlign"
  207. extern DWORD CpuDisableEbpAlign;
  208. /*
  209. * Enable sniff-checking on x86 code found in writable memory
  210. *
  211. * Default = 0 - No sniff-checking performed.
  212. * nonzero - Sniff-check pages with writable attributes.
  213. *
  214. */
  215. #define STR_CPU_SNIFF_WRITABLE_CODE L"CpuSniffWritableCode"
  216. extern DWORD CpuSniffWritableCode;
  217. /*
  218. * Logging verbosity. Only configurable under the debugger.
  219. *
  220. */
  221. extern DWORD ModuleLogFlags;
  222. VOID
  223. GetConfigurationData(
  224. VOID
  225. );
  226. #endif