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.

240 lines
8.9 KiB

  1. /*
  2. * $Log: V:/Flite/archives/TrueFFS5/Src/flchkdef.h_V $
  3. *
  4. * Rev 1.12 Apr 15 2002 07:36:30 oris
  5. * Moved binary module definitions from mtdsa.h.
  6. * Changed automatic definition of missing compilation flags to error massages.
  7. *
  8. * Rev 1.11 Feb 19 2002 20:59:36 oris
  9. * Added check for TL_LEAVE_BINARY_AREA and FL_LEAVE_BINARY_AREA compatibility.
  10. *
  11. * Rev 1.10 Jan 29 2002 20:08:18 oris
  12. * Changed LOW_LEVEL compilation flag with FL_LOW_LEVEL to prevent definition clashes.
  13. *
  14. * Rev 1.9 Jan 23 2002 23:31:26 oris
  15. * Added prevention of multiple include directives.
  16. *
  17. * Rev 1.8 Jan 17 2002 23:00:56 oris
  18. * Changed TrueFFSVersion to "5100"
  19. * Made sure FL_FAR_MALLOC exists
  20. * Made sure MTD_RECONSTRUCT_BBT is defined if FORMAT_VOLUME is defined.
  21. * Made sure QUICK_MOUNT_FEATURE is defined
  22. *
  23. * Rev 1.7 Nov 20 2001 20:25:08 oris
  24. * Changed TrueFFS version to "5040". This version is written by the format routine on the media header.
  25. *
  26. * Rev 1.6 Jul 15 2001 20:44:56 oris
  27. * Changed default DFORMAT_PRINT from nothing to DEBUG_PRINT in order to remove warrnings.
  28. *
  29. * Rev 1.5 Jul 13 2001 01:04:20 oris
  30. * Added definition check for DFORMAT_PRINT,FL_FOPEN , FL_FCLOSE, FL_FPRINTF macros.
  31. *
  32. * Rev 1.4 May 16 2001 21:18:14 oris
  33. * Added backwards compatibility check for FL_MALLOC the new definition replacing MALLOC.
  34. *
  35. * Rev 1.3 Apr 01 2001 07:52:06 oris
  36. * copywrite notice.
  37. * Alligned left all # directives.
  38. *
  39. * Rev 1.2 Feb 13 2001 02:19:44 oris
  40. * Added TrueFFSVersion (internal version label) define.
  41. *
  42. * Rev 1.1 Feb 07 2001 18:55:44 oris
  43. * Added check if LOW_LEVEL is not defined before defining it in Validity check for LOW_LEVEL
  44. *
  45. * Rev 1.0 Feb 05 2001 18:41:14 oris
  46. * Initial revision.
  47. *
  48. */
  49. /***********************************************************************************/
  50. /* M-Systems Confidential */
  51. /* Copyright (C) M-Systems Flash Disk Pioneers Ltd. 1995-2001 */
  52. /* All Rights Reserved */
  53. /***********************************************************************************/
  54. /* NOTICE OF M-SYSTEMS OEM */
  55. /* SOFTWARE LICENSE AGREEMENT */
  56. /* */
  57. /* THE USE OF THIS SOFTWARE IS GOVERNED BY A SEPARATE LICENSE */
  58. /* AGREEMENT BETWEEN THE OEM AND M-SYSTEMS. REFER TO THAT AGREEMENT */
  59. /* FOR THE SPECIFIC TERMS AND CONDITIONS OF USE, */
  60. /* OR CONTACT M-SYSTEMS FOR LICENSE ASSISTANCE: */
  61. /* E-MAIL = [email protected] */
  62. /***********************************************************************************/
  63. /************************/
  64. /* TrueFFS source files */
  65. /* -------------------- */
  66. /************************/
  67. /*****************************************************************************
  68. * File Header *
  69. * ----------- *
  70. * Name : flchkdef.h *
  71. * *
  72. * Description : Sanity check for flcustom.h files. *
  73. * *
  74. *****************************************************************************/
  75. #ifndef _FL_CHK_DEFS_H_
  76. #define _FL_CHK_DEFS_H_
  77. /* Osak version
  78. *
  79. * Number written on the flash by INFTL format specifing the OSAK version
  80. * The media was formated with. the number bellow specifies version
  81. * 5.1.0.0
  82. */
  83. #define TrueFFSVersion "5100" /* Internal TrueFFS version number */
  84. /*******************************************/
  85. /* Validity check and overlapping defines */
  86. /*******************************************/
  87. /* The TL uses a diffrent defintion from the one the public interface uses
  88. * but when format parameters are sent to the TL no convertion is made.
  89. * the result is that both definitions must be the same.
  90. */
  91. #if (defined(TL_LEAVE_BINARY_AREA) && defined(FL_LEAVE_BINARY_AREA))
  92. #if TL_LEAVE_BINARY_AREA != FL_LEAVE_BINARY_AREA
  93. #error "FL_LEAVE_BINARY_AREA and FL_LEAVE_BINARY_AREA must have the same value"
  94. #endif
  95. #endif /* TL_LEAVE_BINARY_AREA && FL_LEAVE_BINARY_AREA */
  96. /* Validiy check for FL_LOW_LEVEL compilation flag.
  97. *
  98. * Starting from TrueFFS 5.1 the LOW_LEVEL was changed to FL_LOW_LEVEL
  99. * The reason was that it clashed with Windows NT LOW_LEVEL macro.
  100. */
  101. #ifndef FL_LOW_LEVEL
  102. #ifdef LOW_LEVEL
  103. #define FL_LOW_LEVEL
  104. #endif /* LOW_LEVEL */
  105. #endif /* FL_LOW_LEVEL */
  106. /* Validiy check for FL_MALLOC and FL_FREE macroes
  107. *
  108. * Starting from TrueFFS 5.0 the FREE and MALLOC macroes were
  109. * changed to FL_MALLOC and FL_FREE in order to avoid name clashes.
  110. * In order to keep backwards compatibility with previous flsystem.h
  111. * files the following new defintions checks were added.
  112. * if your system uses the FREE and MALLOC defintion simply comment
  113. * them out and customized the FL_MALLOC and FL_FREE macroes in your
  114. * flsystem.h file.
  115. */
  116. #if (defined(MALLOC) && !defined(FL_MALLOC))
  117. #define FL_MALLOC MALLOC
  118. #endif /* MALLOC && ! FL_MALLOC */
  119. #if (defined(FREE) && !defined(FL_FREE))
  120. #define FL_FREE FREE
  121. #endif /* FREE && ! FL_FREE */
  122. /* Validity check for FL_FAR_MALLOC and FL_FAR_FREE
  123. * Due to the BIOS driver memory limitations a dedicated routine
  124. * is used for allocating the large ram arrays.
  125. */
  126. #if (defined(FL_MALLOC) && !defined(FL_FAR_MALLOC))
  127. #define FL_FAR_MALLOC FL_MALLOC
  128. #endif /* FL_MALLOC && ! FL_FAR_MALLOC */
  129. #if (defined(FL_FREE) && !defined(FL_FAR_FREE))
  130. #define FL_FAR_FREE FL_FREE
  131. #endif /* FL_MALLOC && ! FL_FAR_MALLOC */
  132. /* Validity check for BDK_ACCESS */
  133. #if (defined (WRITE_EXB_IMAGE) && !defined (BDK_ACCESS))
  134. #error "Please make sure BDK_ACCESS is defined in your flcustom.h file\r\n"
  135. #endif
  136. /* The format option needs some internal defintions */
  137. #ifdef FORMAT_VOLUME
  138. #ifndef MTD_RECONSTRUCT_BBT
  139. #define MTD_RECONSTRUCT_BBT /* Compile code to scan virgin cards for BBT */
  140. #endif /* MTD_RECONSTRUCT_BBT */
  141. #endif /* FORMAT_VOLUME */
  142. /*
  143. * Make sure TrueFFS has all the neccesary definition for the
  144. * Binary partition module.
  145. */
  146. #ifdef BDK_ACCESS
  147. #define ACCESS_BDK_IMAGE /* Compile the Binary read routines */
  148. #ifndef FL_READ_ONLY
  149. #define UPDATE_BDK_IMAGE /* Compile the Binary write routines */
  150. #define ERASE_BDK_IMAGE /* Compile the Binary erase routine */
  151. #define CREATE_BDK_IMAGE /* Compile the Binary create routine */
  152. #endif /* FL_READ_ONLY */
  153. #ifdef HW_PROTECTION
  154. #define PROTECT_BDK_IMAGE /* Compile the Binary protection routines */
  155. #endif /* HW_PROTECTION */
  156. #endif /* BDK_ACCESS */
  157. /* Validity check for system files MACROES */
  158. #ifndef DFORMAT_PRINT
  159. #define DFORMAT_PRINT DEBUG_PRINT
  160. #endif /* DFORMAT_PRINT */
  161. #ifndef FL_FOPEN
  162. #define FL_FOPEN
  163. #endif /* FL_FOPEN */
  164. #ifndef FL_FCLOSE
  165. #define FL_FCLOSE
  166. #endif /* FL_FCLOSE */
  167. #ifndef FL_FPRINTF
  168. #define FL_FPRINTF
  169. #endif /* FL_FPRINTF */
  170. /* Validity check of DRIVES , VOLUMES and SOCKETS parameters.
  171. * Note that DRIVES definition was left for abckwards compatibility
  172. */
  173. #if (defined(DRIVES) && (defined(SOCKETS) || defined(VOLUMES)))
  174. #error "Drives is permited only as long as SOCKETS and VOLUMES are not defined"
  175. #else
  176. #ifdef DRIVES
  177. #define SOCKETS DRIVES
  178. #define VOLUMES DRIVES
  179. #else
  180. #if (!defined(VOLUMES) && !defined(SOCKETS))
  181. #error "Neither DRIVER, VOLUMES and SOCKETS are defined"
  182. #else
  183. #if (!defined(VOLUMES) && defined(SOCKETS))
  184. #define VOLUMES SOCKETS /* both VOLUMES and SOCKETS must be defined */
  185. #else
  186. #if !defined(SOCKETS) && defined(VOLUMES)
  187. #define SOCKETS VOLUMES /* both VOLUMES and SOCKETS must be defined */
  188. #else
  189. #if (SOCKETS>VOLUMES)
  190. #error "SOCKETS should not be bigger then VOLUMES"
  191. #endif /* SOCKETS > VOLUMES */
  192. #endif /* ! SOCKETS && VOLUMES */
  193. #endif /* SOCKETS && ! VOLUMES */
  194. #endif /* ! SOCKETS && ! VOLUMES */
  195. #endif /* DRIVES */
  196. #endif /* DRIVES && (SOCKETS || VOLUMES) */
  197. /*****************************/
  198. /* M-Systems forced defaults */
  199. /*****************************/
  200. /* Since TrueFFS 5.1 Quick mount is a default for all INFTL formated devices */
  201. #define QUICK_MOUNT_FEATURE
  202. /* Some S/W modules like boot SDK do not need the read bad blocks tables routine.
  203. * However for TrueFFS these defintion is vital
  204. */
  205. #define MTD_READ_BBT /* Compile the read BBT routine code */
  206. #endif /* _FL_CHK_DEFS_H_ */