usrExtra.c
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:14k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* usrExtra.c - optionally included modules */
  2. /* Copyright 1992-2002 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 02x,13mar02,sn   SPR 74275 -  added INCLUDE_NO_CPLUS_DEMANGLER
  7. 02w,11mar02,mas  updated to use usrSmObj.c configlette (SPR 73371)
  8. 02v,11mar02,sn   Wind Foundation classes no longer supported (SPR #73967)
  9. 02u,11mar02,sn   removed INCLUDE_GNU_64BIT (now part of INCLUDE_GNU_INTRINSICS)
  10. 02t,27feb02,sn   move intrinsics pull-in code to intrinsics.c
  11. 02s,18jan02,h_k  removed SH intrinsics.
  12. 02r,03jan02,mrs  Fix to conform to ANSI standard for token pasting.
  13. 02q,12dec01,sn   Fix TOOL_CONFIG_HEADER
  14. 02p,10dec01,jlb  Change UGL to WindML
  15. 02o,07dec01,sn   added INCLUDE_CPLUS_DEMANGLER
  16. 02n,06nov01,sn   use toolchain specific C++ components
  17. 02m,30oct01,sn   added INCLUDE_GNU_INTRINSICS, INCLUDE_DIAB_INTRINSICS
  18.                  removed MIPS intrinsics (obsolete now we're building with Diab)  
  19. 02l,03oct01,jkf  added dosFs2 declarations to match components in 10dosfs2.cdf
  20. 02k,27sep01,jkf  removed dosFs non-ansi declarations.
  21. 02i,10jul01,mem  Updated MIPS intrinsics.
  22. 02j,13jul01,kab  Cleanup for merge to mainline
  23. 02i,10may01,dtr  Adding in usrAltivec.c.
  24. 02h,16nov98,jpd  added use of INCLUDE_MMU_MPU.
  25. 02b,30jun00,zl   added dosFs 2.0 related functions
  26. 02a,08jun00,csi  Merging dir for vxfusion
  27. 01z,03mar00,zl   merged SH support into T2
  28. 02c,03apr01,max  introducing AltiVec save/restore entries for vector registers
  29. 02b,24jan01,sn   added long long support
  30. 02a,11oct00,sn   updated for new C++ components
  31. 01y,10mar99,drm  changed WINDMP to VXFUSION to reflect new product name
  32. 01x,11feb99,sn   corrected logic that defines INCLUDE_CPLUS_STRING
  33. 01w,26jan99,jco  merged from graphics2_0 branch
  34. 01v,29may98,bjl  added INCLUDE_CODETEST.
  35. 02g,01sep98,drm  adding conditional include of usrWindMP.c
  36. 02f,08jul98,cym  removed undef of ANSI_MATH for SIMNT.
  37. 02e,03jun98,sn   cleanup up mod history.
  38.                  added new C++ configuration options splitting between
  39.                  basic, Standard Template Library, string class, complex class
  40.  and iostreams. 
  41.  distinguished INCLUDE_CPLUS_IOSTREAMS
  42.  (everything needed by iostream.o) from 
  43.  INCLUDE_CPLUS_IOSTREAMS_FULL.
  44.  removed INCLUDE_CPLUS_HEAP and INCLUDE_CPLUS_BOOCH since
  45.  they are no-ops.
  46. 02d,13may98,dbt  removed optional modules included by WDB since the scalable
  47.  agent has be redesigned.
  48. 02c,13jan98,dbt  adding conditional include of usrBreakpoint.c
  49. 02b,18dec97,cth  added conditional include of usrWindview.c
  50. 02a,19nov97,hdn  added support for TFFS.
  51. 01u,03dec96,tpr  removed the reference to __cmpsf2 for the I960 familly.
  52. 01t,01nov96,hdn  added support for PCMCIA.
  53. 01s,23jul96,hdn  added support for ATA driver.
  54. 01r,23jun95,tpr  added #ifdef INCLUDE_WDB
  55. 01q,20jun95,srh  make iostreams separately configurable.
  56. 01p,14jun95,srh  normalized names of C++ init files.
  57. 01o,13jun95,srh  added triggers for optional C++ products.
  58. 01n,20may95,jcf  added WDB.
  59. 01m,29mar95,kdl  added INCLUDE_GCC_FP; added reference to __fixunssfsi();
  60.  made MC68060 use same gcc support as MC68040.
  61. 01l,22aug94,dzb  added INCLUDE_NETWORK conditional (SPR #1147).
  62. 01k,06nov94,tmk  added MC68LC040 support
  63. 01j,16jun94,tpr  Added MC68060 cpu support.
  64. 01i,25oct93,hdn  added support for floppy and IDE device.
  65. 01h,25mar94,jmm  changed C++ to check for either full or min, not both
  66. 01g,08apr94,kdl  changed aio_show() reference to aioShow().
  67. 01f,28jan94,dvs  changed INCLUDE_POSIX_MEM_MAN to INCLUDE_POSIX_MEM
  68. 01e,02dec93,dvs  added POSIX A-I/O show configuration
  69. 01d,22nov93,dvs  added INCLUDE_POSIX_SCHED, INCLUDE_POSIX_MMAN, and 
  70.  INCLUDE_POSIX_FTRUNCATE
  71. 01c,23aug93,srh  Added INCLUDE_CPLUS_MIN to the conditions for making
  72.    sysCplusEnable TRUE.
  73. 01b,30oct92,smb  forced include of libfpg.a for 960
  74. 01a,18sep92,jcf  written.
  75. */
  76. /*
  77. DESCRIPTION
  78. This file is used to include extra modules necessary to satisfy the desired
  79. configuration specified by configAll.h and config.h. This file is included
  80. by usrConfig.c.
  81. SEE ALSO: usrDepend.c
  82. NOMANUAL
  83. */
  84. #ifndef  __INCusrExtrac
  85. #define  __INCusrExtrac 
  86. /*
  87.  * Extra modules to be included in VxWorks.  These modules are
  88.  * not referred in the VxWorks code, so they will not be
  89.  * automatically linked in unless they are defined here explicitly.
  90.  *
  91.  */
  92. extern VOIDFUNCPTR __cmpsf2();
  93. VOIDFUNCPTR usrExtraModules [] =
  94.     {
  95.     usrInit, /* provided in case of null array */
  96. #if CPU_FAMILY==MIPS
  97. #ifdef INCLUDE_RPC
  98.     (VOIDFUNCPTR) xdr_float,
  99. #endif
  100. #endif /* CPU_FAMILY==MIPS */
  101. #if CPU_FAMILY==MC680X0 && !(CPU==MC68040) && !(CPU==MC68060)
  102. #ifdef  INCLUDE_GCC_FP
  103.     (VOIDFUNCPTR) gccMathInit,
  104.     (VOIDFUNCPTR) gccUssInit,
  105.     (VOIDFUNCPTR) __fixunssfsi,
  106. #endif
  107. #endif  /* CPU_FAMILY==MC680X0 && !(CPU==MC68040) && !(CPU==MC68060  */
  108. #if     (CPU==MC68040) || (CPU==MC68060)
  109. #ifdef  INCLUDE_GCC_FP
  110.     (VOIDFUNCPTR) gccUss040Init,
  111.     (VOIDFUNCPTR) __fixunssfsi,
  112. #endif
  113. #endif  /* (CPU==MC68040) || (CPU==MC68060) */
  114. #ifdef  INCLUDE_NETWORK
  115. #ifdef  INCLUDE_NET_SHOW
  116.     netShowInit,
  117. #endif
  118. #endif  /* INCLUDE_NETWORK */
  119. #ifdef INCLUDE_TASK_VARS
  120.     (VOIDFUNCPTR) taskVarInit,
  121. #endif
  122. #ifdef  INCLUDE_LOADER
  123.     (VOIDFUNCPTR) loadModule,
  124. #endif
  125. #ifdef  INCLUDE_UNLOADER
  126.     (VOIDFUNCPTR) unld,
  127. #endif
  128. #ifdef INCLUDE_DOSFS              /* usrDosFsOld.c, dosFs1 API wrapper */
  129.     (VOIDFUNCPTR) dosFsDevInit,
  130. #endif /* INCLUDE_DOSFS  */
  131. #ifdef INCLUDE_DOSFS_MAIN         /* dosFsLib (2) */
  132.     (VOIDFUNCPTR) dosFsLibInit,
  133. #endif /* INCLUDE_DOSFS_MAIN  */
  134. #ifdef INCLUDE_DOSFS_FAT          /* dosFs FAT12/16/32 FAT table handler */
  135.     (VOIDFUNCPTR) dosFsFatInit,
  136. #endif /* INCLUDE_DOSFS_FAT */
  137. #ifdef INCLUDE_DOSFS_DIR_VFAT     /* Microsoft VFAT dirent handler */
  138.     (VOIDFUNCPTR) dosVDirLibInit,
  139. #endif /* INCLUDE_DOSFS_DIR_VFAT */
  140. #ifdef INCLUDE_DOSFS_DIR_FIXED    /* 8.3 & VxLongNames directory handler */
  141.     (VOIDFUNCPTR) dosDirOldLibInit,
  142. #endif /* INCLUDE_DOSFS_DIR_FIXED */
  143. #ifdef INCLUDE_DOSFS_FMT          /* dosFs2 file system formatting module */
  144.     (VOIDFUNCPTR) dosFsFmtLibInit,
  145. #endif /* INCLUDE_DOSFS_FMT */
  146. #ifdef INCLUDE_DOSFS_CHKDSK       /* file system integrity checking */
  147.     (VOIDFUNCPTR) dosChkLibInit,
  148. #endif /* INCLUDE_DOSFS_CHKDSK */
  149. #ifdef INCLUDE_CBIO               /* CBIO API module */
  150.     (VOIDFUNCPTR) cbioLibInit, 
  151. #endif /* INCLUDE_CBIO */
  152. #ifdef INCLUDE_DISK_CACHE         /* CBIO API disk caching layer */
  153.     (VOIDFUNCPTR) dcacheDevCreate,
  154. #endif /* INCLUDE_DISK_CACHE */
  155. #ifdef INCLUDE_DISK_PART         /* disk partition handling code, fdisk... */
  156.     (VOIDFUNCPTR) dpartDevCreate,
  157.     (VOIDFUNCPTR) usrFdiskPartRead,
  158. #endif /* INCLUDE_DISK_PART */
  159. #ifdef INCLUDE_DISK_UTIL        /* ls, cd, mkdir, xcopy, etc */
  160.     (VOIDFUNCPTR) ls,
  161. #endif /* INCLUDE_DISK_UTIL */
  162. #ifdef INCLUDE_TAR              /* tar utility */
  163.     (VOIDFUNCPTR) tarExtract,
  164. #endif /* INCLUDE_TAR */
  165. #ifdef INCLUDE_RAM_DISK         /* CBIO API ram disk driver */
  166.     (VOIDFUNCPTR) ramDiskDevCreate,
  167. #endif /* INCLUDE_RAM_DISK */
  168. #ifdef  INCLUDE_POSIX_TIMERS
  169.     (VOIDFUNCPTR) nanosleep,
  170.     (VOIDFUNCPTR) clock_gettime,
  171. #endif
  172. #ifdef  INCLUDE_POSIX_SCHED
  173.     (VOIDFUNCPTR) sched_setparam,
  174. #endif
  175. #ifdef  INCLUDE_POSIX_MEM
  176.     (VOIDFUNCPTR) mlockall,
  177. #endif
  178. #ifdef  INCLUDE_POSIX_FTRUNC
  179.     (VOIDFUNCPTR) ftruncate,
  180. #endif
  181. #if defined(INCLUDE_POSIX_AIO) && defined(INCLUDE_SHOW_ROUTINES)
  182.     (VOIDFUNCPTR) aioShow,
  183. #endif /* defined(INCLUDE_POSIX_AIO) && defined(INCLUDE_SHOW_ROUTINES */
  184. #ifdef  INCLUDE_NETWORK
  185. #ifdef  INCLUDE_TFTP_CLIENT
  186.     (VOIDFUNCPTR) tftpCopy,
  187. #endif
  188. #endif  /* INCLUDE_NETWORK */
  189.     };
  190. #ifdef  INCLUDE_ANSI_ASSERT
  191. #include "../../src/config/assertInit.c"
  192. #endif
  193. #ifdef  INCLUDE_ANSI_CTYPE
  194. #include "../../src/config/ctypeInit.c"
  195. #endif
  196. #ifdef  INCLUDE_ANSI_LOCALE
  197. #include "../../src/config/localeInit.c"
  198. #endif
  199. #ifdef  INCLUDE_ANSI_MATH
  200. #include "../../src/config/mathInit.c"
  201. #endif
  202. #ifdef  INCLUDE_ANSI_STDIO
  203. #include "../../src/config/stdioInit.c"
  204. #endif
  205. #ifdef  INCLUDE_ANSI_STDLIB
  206. #include "../../src/config/stdlibInit.c"
  207. #endif
  208. #ifdef  INCLUDE_ANSI_STRING
  209. #include "../../src/config/stringInit.c"
  210. #endif
  211. #ifdef  INCLUDE_DSP
  212. #include "../../src/config/usrDsp.c"
  213. #endif
  214. #ifdef  INCLUDE_ALTIVEC
  215. /* AltiVec run-time support */
  216. #include "../../src/config/SaveRestVR.c"
  217. #include "../../src/config/usrAltivec.c"
  218. #endif
  219. #ifdef  INCLUDE_ANSI_TIME
  220. #include "../../src/config/timeInit.c"
  221. #endif
  222. #ifdef  INCLUDE_ANSI_5_0
  223. #include "../../src/config/ansi_5_0.c"
  224. #endif
  225. #ifdef INCLUDE_FD
  226. #include "../../src/config/usrFd.c"
  227. #endif
  228. #ifdef INCLUDE_IDE
  229. #include "../../src/config/usrIde.c"
  230. #endif
  231. #ifdef INCLUDE_ATA
  232. #include "../../src/config/usrAta.c"
  233. #endif
  234. #ifdef INCLUDE_PCMCIA
  235. #include "../../src/config/usrPcmcia.c"
  236. #endif
  237. #ifdef INCLUDE_TFFS
  238. #include "../../src/config/usrTffs.c"
  239. #endif
  240. #ifdef INCLUDE_NET_SYM_TBL
  241. #include "../../src/config/usrLoadSym.c"
  242. #endif /* INCLUDE_NET_SYM_TBL */
  243. #if defined(INCLUDE_MMU_BASIC) || defined(INCLUDE_MMU_FULL) || 
  244. defined(INCLUDE_MMU_MPU)
  245. #include "../../src/config/usrMmuInit.c"
  246. #endif /* defined(INCLUDE_MMU_BASIC, INCLUDE_MMU_FULL, INCLUDE_MMU_MPU) */
  247. #ifdef INCLUDE_NETWORK
  248. #include "../../src/config/usrNetwork.c"
  249. #endif
  250. #ifdef INCLUDE_STARTUP_SCRIPT
  251. #include "../../src/config/usrScript.c"
  252. #endif /* INCLUDE_STARTUP_SCRIPT */
  253. #ifdef INCLUDE_SCSI
  254. #include "../../src/config/usrScsi.c"
  255. #endif
  256. #ifdef INCLUDE_SM_OBJ
  257. #include "../../config/comps/src/usrSmObj.c"
  258. #endif
  259. #ifdef INCLUDE_VXFUSION
  260. #include "../../src/config/usrVxFusion.c"
  261. #endif
  262. #ifdef INCLUDE_WDB
  263. #include "../../src/config/usrWdb.c"
  264. #endif
  265. #ifdef INCLUDE_WINDML
  266. #include "../../src/config/usrWindMl.c"
  267. #endif
  268. #ifdef  INCLUDE_JAVA
  269. #include "../../src/config/usrJava.c"
  270. #endif
  271. #ifdef  INCLUDE_HTML
  272. #include "../../src/config/usrHtml.c"
  273. #endif
  274. #ifdef INCLUDE_ADA
  275. BOOL  sysAdaEnable = TRUE; /* TRUE = enable Ada support options */
  276. #else
  277. BOOL  sysAdaEnable = FALSE;
  278. #endif
  279. #ifdef  INCLUDE_CODETEST
  280. #include "../../src/config/CodeTEST.c"
  281. #endif
  282. #include "../../src/config/intrinsics.c"
  283. /* All this to generate a string we can #include */
  284. #ifndef TOOL_FAMILY
  285. #   define TOOL_FAMILY gnu
  286. #endif
  287. #define TOOL_CONFIG_HDR_STRINGIFY(x)  #x
  288. #define TOOL_CONFIG_HDR2(tc, file) TOOL_CONFIG_HDR_STRINGIFY(cplus##tc##file.c)
  289. #define TOOL_CONFIG_HDR1(tc, file) TOOL_CONFIG_HDR2(tc, file)
  290. #define TOOL_CONFIG_HEADER(file) TOOL_CONFIG_HDR1(TOOL_FAMILY, file)
  291. /* C++ configuration */
  292. #if     defined (INCLUDE_CPLUS_STL)
  293. #ifndef INCLUDE_CPLUS
  294. #define INCLUDE_CPLUS
  295. #endif /* INCLUDE_CPLUS */
  296. #include TOOL_CONFIG_HEADER(Stl)
  297. #endif
  298. #if     defined (INCLUDE_CPLUS_COMPLEX_IO)
  299. #ifndef INCLUDE_CPLUS
  300. #define INCLUDE_CPLUS
  301. #endif /* INCLUDE_CPLUS */
  302. #ifndef INCLUDE_CPLUS_COMPLEX
  303. #define INCLUDE_CPLUS_COMPLEX
  304. #endif /* INCLUDE_CPLUS_COMPLEX */
  305. #include TOOL_CONFIG_HEADER(ComplexIo)
  306. #endif
  307. #if     defined (INCLUDE_CPLUS_COMPLEX)
  308. #ifndef INCLUDE_CPLUS
  309. #define INCLUDE_CPLUS
  310. #endif /* INCLUDE_CPLUS */
  311. #include TOOL_CONFIG_HEADER(Complex)
  312. #endif
  313. #if     defined (INCLUDE_CPLUS_STRING_IO)
  314. #ifndef INCLUDE_CPLUS
  315. #define INCLUDE_CPLUS
  316. #endif /* INCLUDE_CPLUS */
  317. #ifndef INCLUDE_CPLUS_STRING
  318. #define INCLUDE_CPLUS_STRING
  319. #endif /* INCLUDE_CPLUS_STRING */
  320. #include TOOL_CONFIG_HEADER(StringIo)
  321. #endif
  322. #if     defined (INCLUDE_CPLUS_STRING)
  323. #ifndef INCLUDE_CPLUS
  324. #define INCLUDE_CPLUS
  325. #endif /* INCLUDE_CPLUS */
  326. #include TOOL_CONFIG_HEADER(String)
  327. #endif
  328. #if defined (INCLUDE_CPLUS_IOSTREAMS)||defined(INCLUDE_CPLUS_IOSTREAMS_FULL)
  329. #ifndef INCLUDE_CPLUS
  330. #define INCLUDE_CPLUS
  331. #endif /* INCLUDE_CPLUS */
  332. #include TOOL_CONFIG_HEADER(Ios)
  333. #endif
  334. #if defined(INCLUDE_CPLUS) && 
  335.     (defined(INCLUDE_SHELL) || 
  336.      defined(INCLUDE_SYM_TBL_SHOW) || 
  337.      defined(INCLUDE_DEBUG) || 
  338.      defined(INCLUDE_SPY) || 
  339.      defined(INCLUDE_TIMEX))
  340. #ifndef INCLUDE_CPLUS_DEMANGLER
  341. #define INCLUDE_CPLUS_DEMANGLER
  342. #endif
  343. #endif
  344. #ifdef INCLUDE_NO_CPLUS_DEMANGLER
  345. #undef INCLUDE_CPLUS_DEMANGLER
  346. #endif
  347. #ifdef INCLUDE_CPLUS
  348. #ifndef INCLUDE_CPLUS_LANG
  349. #define INCLUDE_CPLUS_LANG
  350. #endif
  351. #endif
  352. #ifdef INCLUDE_CPLUS_LANG
  353. #ifndef INCLUDE_CPLUS
  354. #define INCLUDE_CPLUS
  355. #endif
  356. #include TOOL_CONFIG_HEADER(Lang)
  357. #endif
  358. #if defined (INCLUDE_CPLUS) || defined (INCLUDE_CPLUS_MIN)
  359. BOOL  sysCplusEnable = TRUE; /* TRUE = enable C++ support */
  360. #else
  361. BOOL  sysCplusEnable = FALSE;
  362. #endif
  363. /* END C++ configuration */
  364. #if (defined(INCLUDE_WDB_BP) && defined (INCLUDE_WDB)) || 
  365. defined (INCLUDE_DEBUG) || defined(INCLUDE_SHELL)
  366. #include "../../src/config/usrBreakpoint.c"
  367. #endif
  368. #if defined (INCLUDE_WINDVIEW)
  369. #include "../../src/config/usrWindview.c"
  370. #endif
  371. #ifdef  INCLUDE_DELETE_5_0
  372. /*******************************************************************************
  373. *
  374. * delete - delete a file (obsolete routine)
  375. *
  376. * This routine is provided for binary compatibility with VxWorks 5.0
  377. * and earlier versions which define this function.  This interface
  378. * has been removed from VxWorks because "delete" is a reserved word
  379. * in C++.
  380. *
  381. * Source code which uses delete() may be recompiled using a special
  382. * macro in ioLib.h which will translate delete() calls into remove()
  383. * calls.  To enable the macro, define __DELETE_FUNC as TRUE in ioLib.h.
  384. *
  385. * If code is recompiled in this way, it is not necessary to include
  386. * the delete() routine defined here.
  387. *
  388. * RETURNS: OK, or ERROR.
  389. *
  390. * SEE ALSO: remove(), unlink(), ioLib.h
  391. *
  392. * NOMANUAL
  393. */
  394. STATUS delete 
  395.     (
  396.     const char *filename /* filename to delete */
  397.     )
  398.     {
  399.     return (remove (filename));
  400.     }
  401. #endif  /* INCLUDE_DELETE_5_0 */
  402. #if (defined(INCLUDE_FD) || defined(INCLUDE_IDE) || 
  403.  defined(INCLUDE_ATA) || defined(INCLUDE_PCMCIA) || 
  404.  defined(INCLUDE_TFFS))
  405. /******************************************************************************
  406. *
  407. * devSplit - split the device name from a full path name
  408. *
  409. * This routine returns the device name from a valid UNIX-style path name
  410. * by copying until two slashes ("/") are detected.  The device name is
  411. * copied into <devName>.
  412. *
  413. * RETURNS: N/A
  414. *
  415. * NOMANUAL
  416. */
  417. void devSplit
  418.     (
  419.     FAST char *fullFileName,    /* full file name being parsed */
  420.     FAST char *devName          /* result device name */
  421.     )
  422.     {
  423.     FAST int nChars = 0;
  424.     if (fullFileName != NULL)
  425. {
  426.         char *p0 = fullFileName;
  427.         char *p1 = devName;
  428.         while ((nChars < 2) && (*p0 != EOS))
  429.     {
  430.             if (*p0 == '/')
  431.                 nChars++;
  432.     *p1++ = *p0++;
  433.             }
  434.         *p1 = EOS;
  435.         }
  436.     else
  437. {
  438.         (void) strcpy (devName, "");
  439. }
  440.     }
  441. #endif /* (defined (INCLUDE_FD) || (IDE) || (ATA) || (PCMCIA) || (TFFS)) */
  442. #endif /* __INCusrExtrac */