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

VxWorks

开发平台:

C/C++

  1. /* prjConfig.c - dynamicaly generated configuration file */
  2. /*
  3. GENERATED: Mon Nov 18 14:13:03 PST 2002
  4. DO NOT EDIT - file is regenerated whenever the project changes.
  5. This file contains the non-BSP system initialization code
  6. for Create a bootable VxWorks image (custom configured).
  7. */
  8. /* includes */
  9. #include "vxWorks.h"
  10. #include "config.h"
  11. #include "bsdSockLib.h"
  12. #include "bufLib.h"
  13. #include "cacheLib.h"
  14. #include "configNet.h"
  15. #include "cplusLib.h"
  16. #include "drv/timer/timerDev.h"
  17. #include "drv/wdb/wdbEndPktDrv.h"
  18. #include "drv/wdb/wdbVioDrv.h"
  19. #include "end.h"
  20. #include "envLib.h"
  21. #include "eventLib.h"
  22. #include "excLib.h"
  23. #include "fioLib.h"
  24. #include "ftpLib.h"
  25. #include "hashLib.h"
  26. #include "hostLib.h"
  27. #include "intLib.h"
  28. #include "ioLib.h"
  29. #include "iosLib.h"
  30. #include "ipProto.h"
  31. #include "logLib.h"
  32. #include "lstLib.h"
  33. #include "math.h"
  34. #include "memLib.h"
  35. #include "msgQLib.h"
  36. #include "muxLib.h"
  37. #include "muxTkLib.h"
  38. #include "net/mbuf.h"
  39. #include "netBufLib.h"
  40. #include "netDrv.h"
  41. #include "netLib.h"
  42. #include "netinet/if_ether.h"
  43. #include "pipeDrv.h"
  44. #include "private/ftpLibP.h"
  45. #include "private/funcBindP.h"
  46. #include "private/kernelLibP.h"
  47. #include "private/taskLibP.h"
  48. #include "private/vmLibP.h"
  49. #include "private/workQLibP.h"
  50. #include "private/wvFileUploadPathLibP.h"
  51. #include "private/wvTsfsUploadPathLibP.h"
  52. #include "private/wvUploadPathP.h"
  53. #include "qPriBMapLib.h"
  54. #include "rBuffLib.h"
  55. #include "rebootLib.h"
  56. #include "remLib.h"
  57. #include "selectLib.h"
  58. #include "semLib.h"
  59. #include "sigLib.h"
  60. #include "sioLib.h"
  61. #include "stdio.h"
  62. #include "string.h"
  63. #include "symLib.h"
  64. #include "sys/socket.h"
  65. #include "sysLib.h"
  66. #include "taskHookLib.h"
  67. #include "taskLib.h"
  68. #include "taskVarLib.h"
  69. #include "tickLib.h"
  70. #include "timexLib.h"
  71. #include "ttyLib.h"
  72. #include "usrConfig.h"
  73. #include "version.h"
  74. #include "vxLib.h"
  75. #include "wdLib.h"
  76. #include "wdb/wdb.h"
  77. #include "wdb/wdbBpLib.h"
  78. #include "wdb/wdbCommIfLib.h"
  79. #include "wdb/wdbLib.h"
  80. #include "wdb/wdbLibP.h"
  81. #include "wdb/wdbMbufLib.h"
  82. #include "wdb/wdbRpcLib.h"
  83. #include "wdb/wdbRtIfLib.h"
  84. #include "wdb/wdbSvcLib.h"
  85. #include "wdb/wdbUdpLib.h"
  86. #include "wdb/wdbVioLib.h"
  87. #include "wvLib.h"
  88. #include "wvTmrLib.h"
  89. /* imports */
  90. IMPORT char etext [];                   /* defined by loader */
  91. IMPORT char end [];                     /* defined by loader */
  92. IMPORT char edata [];                   /* defined by loader */
  93. /* BSP_STUBS */
  94. /* configlettes */
  95. #include "sysComms.c"
  96. #include "intrinsics.c"
  97. #include "net/usrBootLine.c"
  98. #include "net/usrBsdSocket.c"
  99. #include "net/usrEndLib.c"
  100. #include "net/usrFtp.c"
  101. #include "net/usrNetBoot.c"
  102. #include "net/usrNetBootUtil.c"
  103. #include "net/usrNetConfigIf.c"
  104. #include "net/usrNetEndBoot.c"
  105. #include "net/usrNetIcmp.c"
  106. #include "net/usrNetIpLib.c"
  107. #include "net/usrNetLib.c"
  108. #include "net/usrNetLoopbackStart.c"
  109. #include "net/usrNetMuxCfg.c"
  110. #include "net/usrNetRemoteCfg.c"
  111. #include "net/usrTcp.c"
  112. #include "net/usrUdp.c"
  113. #include "sysClkInit.c"
  114. #include "usrBreakpoint.c"
  115. #include "usrCache.c"
  116. #include "usrKernel.c"
  117. #include "usrMmuInit.c"
  118. #include "usrSerial.c"
  119. #include "usrStartup.c"
  120. #include "usrWdbBanner.c"
  121. #include "usrWdbBp.c"
  122. #include "usrWdbCore.c"
  123. #include "usrWdbSys.c"
  124. #include "usrWdbTask.c"
  125. #include "usrWindview.c"
  126. #include "usrWvFileUploadPath.c"
  127. #include "usrWvTsfsUploadPath.c"
  128. #include "wdbEnd.c"
  129. /******************************************************************************
  130. *
  131. * usrInit - pre-kernel initialization
  132. */
  133. void usrInit (int startType)
  134.     {
  135.     sysStart (startType);               /* clear BSS and set up the vector table base address. */
  136.     cacheLibInit (USER_I_CACHE_MODE, USER_D_CACHE_MODE); /* include cache support */
  137.     excVecInit ();                      /* exception handling */
  138.     sysHwInit ();                       /* call the BSPs sysHwInit routine during system startup */
  139.     usrCacheEnable ();                  /* optionally enable caches */
  140.     wvLibInit ();                       /* low-level kernel instrumentation needed by windview */
  141.     usrKernelInit ();                   /* context switch and interrupt handling. DO NOT REMOVE. */
  142.     }
  143. /******************************************************************************
  144. *
  145. * usrNetProtoInit - Initialize the network protocol stacks
  146. */
  147. void usrNetProtoInit (void)
  148.     {
  149.     usrBsdSockLibInit();                /* BSD Socket Support */
  150.     hostTblInit();                      /* Host Table Support */
  151.     usrIpLibInit();                     /* BSD 4.4 IPv4 */
  152.     udpLibInit (&udpCfgParams);         /* BSD 4.4. UDPv4 */
  153.     tcpLibInit (&tcpCfgParams);         /* BSD 4.4 TCPv4 */
  154.     icmpLibInit (&icmpCfgParams);       /* BSD 4.4 ICMPv4 */
  155.     igmpLibInit();                      /* BSD 4.4 IGMPv4 */
  156.     netLibInit();                       /* creates the network task that runs low-level  network interface routines in a task context */
  157.                                         /* Includes the ARP cache APIs */
  158.     }
  159. /******************************************************************************
  160. *
  161. * usrNetworkAddrInit - Initialize the network address for a device
  162. */
  163. void usrNetworkAddrInit (void)
  164.     {
  165.     usrDhcpcLeaseClean ();              /* Deletes DHCP time values from address field */
  166.     }
  167. /******************************************************************************
  168. *
  169. * usrNetworkDevStart - Attach a network device and start the loopback driver
  170. */
  171. void usrNetworkDevStart (void)
  172.     {
  173.     usrNetEndDevStart (pDevName, uNum); /* Uses boot parameters to start an END driver */
  174.     usrNetLoopbackStart ();             /* loopback interface for routining to localhost */
  175.     }
  176. /******************************************************************************
  177. *
  178. * usrNetworkBoot - Setup a network device using the boot parameters
  179. */
  180. void usrNetworkBoot (void)
  181.     {
  182.     usrNetBoot ();                      /* Reads the enet address from the bootline parameters */
  183.     usrNetworkAddrInit ();              /* Initialize the network address for a device */
  184.     usrNetmaskGet ();                   /* Extracts netmask value from address field */
  185.     usrNetDevNameGet ();                /* Gets name from "other" field if booting from disk */
  186.     usrNetworkDevStart ();              /* Attach a network device and start the loopback driver */
  187.     }
  188. /******************************************************************************
  189. *
  190. * usrNetworkAddrCheck - Get an IP address if needed and setup the boot device
  191. */
  192. void usrNetworkAddrCheck (void)
  193.     {
  194.     usrNetConfig (pDevName, uNum, pTgtName, pAddrString); /* Assigns an IP address and netmask */
  195.     }
  196. /******************************************************************************
  197. *
  198. * usrNetRemoteInit - 
  199. */
  200. void usrNetRemoteInit (void)
  201.     {
  202.     usrNetHostSetup ();                 /* Route creation and hostname setup */
  203.     usrNetRemoteCreate ();              /* Allows access to file system on boot host */
  204.     }
  205. /******************************************************************************
  206. *
  207. * usrNetAppInit - 
  208. */
  209. void usrNetAppInit (void)
  210.     {
  211.     usrFtpInit();                       /* File Transfer Protocol (FTP) library */
  212.     }
  213. /******************************************************************************
  214. *
  215. * usrNetworkInit - Initialize the network subsystem
  216. */
  217. void usrNetworkInit (void)
  218.     {
  219.     usrNetLibInit ();                   /* network buffer creation and device support */
  220.     usrNetProtoInit ();                 /* Initialize the network protocol stacks */
  221.     usrMuxLibInit ();                   /* network driver to protocol multiplexer */
  222.     usrEndLibInit();                    /* Support for network devices using MUX/END interface */
  223.                                         /* This should always be included for backward compatibility */
  224.     usrNetworkBoot ();                  /* Setup a network device using the boot parameters */
  225.     usrNetworkAddrCheck ();             /* Get an IP address if needed and setup the boot device */
  226.     usrNetRemoteInit ();                /* initialize network remote I/O access */
  227.     usrNetAppInit ();                   /* initialize network application protocols */
  228.     }
  229. /******************************************************************************
  230. *
  231. * usrWdbInit - the WDB target agent
  232. */
  233. void usrWdbInit (void)
  234.     {
  235.     wdbConfig ();                       /* software agent to support the tornado tools */
  236.     wdbMemLibInit ();                   /* read/write target memory */
  237.     wdbSysModeInit ();                  /* A breakpoint stops the entire operating system. */
  238.     wdbTaskModeInit ();                 /* A breakpoint stops one task, while others keep running. */
  239.     wdbEventLibInit ();                 /* asynchronous event handling needed for breakpoints etc. */
  240.     wdbEvtptLibInit ();                 /* support library for breakpoints and other asynchonous events. */
  241.     wdbDirectCallLibInit ();            /* call arbitrary functions directly from WDB */
  242.     wdbCtxLibInit ();                   /* create/delete/manipulate tasks */
  243.     wdbRegsLibInit ();                  /* get/set registers */
  244.     wdbGopherLibInit ();                /* information gathering language used by many tools */
  245.     wdbCtxExitLibInit ();               /* ability to notify the host when a task exits */
  246.     wdbExcLibInit ();                   /* notify the host when an exception occurs */
  247.     wdbFuncCallLibInit ();              /* asynchronous function calls */
  248.     wdbVioLibInit ();                   /* low-level virtual I/O handling */
  249.     wdbVioDrv ("/vio");                 /* vxWorks driver for accessing virtual I/O */
  250.     usrWdbBp ();                        /* core breakpoint library */
  251.     wdbTaskBpLibInit ();                /* task-mode breakpoint library */
  252.     wdbCtxStartLibInit ();              /* ability to notify the host when a task starts */
  253.     wdbUserEvtLibInit ();               /* ability to send user events to the host */
  254.     usrWdbBanner ();                    /* print banner to console after the agent is initialized */
  255.     }
  256. /******************************************************************************
  257. *
  258. * usrWindviewInit - 
  259. */
  260. void usrWindviewInit (void)
  261.     {
  262.     windviewConfig ();                  /* initialize and control event logging */
  263.     wvTmrRegister ((UINTFUNCPTR) USER_TIMESTAMP, (UINTFUNCPTR) USER_TIMESTAMPLOCK, (FUNCPTR)     USER_TIMEENABLE, (FUNCPTR)     USER_TIMEDISABLE, (FUNCPTR)     USER_TIMECONNECT, (UINTFUNCPTR) USER_TIMEPERIOD, (UINTFUNCPTR) USER_TIMEFREQ); /* user-defined timestamp routines */
  264.     rBuffLibInit ();                    /* windview 2.0 ring of buffers for event logging  */
  265.     wdbTsfsDrv ("/tgtsvr");             /* virtual file system based on the WDB agent */
  266.     usrWvTsfsUploadPathInit ();         /* initialize path for the upload through TSFS socket  */
  267.     usrWvFileUploadPathInit ();         /* initialize path for the upload to file  */
  268.     }
  269. /******************************************************************************
  270. *
  271. * usrShowInit - enable object show routines
  272. */
  273. void usrShowInit (void)
  274.     {
  275.     taskShowInit ();                    /* task show routine */
  276.     msgQShowInit ();                    /* message queue show routine */
  277.     }
  278. /******************************************************************************
  279. *
  280. * usrToolsInit - software development tools
  281. */
  282. void usrToolsInit (void)
  283.     {
  284.     timexInit ();                       /* utility to measure function execution time */
  285.     usrWdbInit ();                      /* the WDB target agent */
  286.     usrWindviewInit ();                 /* usrWindviewInit */
  287.     usrShowInit ();                     /* enable object show routines */
  288.     }
  289. /******************************************************************************
  290. *
  291. * usrKernelCoreInit - core kernel facilities
  292. */
  293. void usrKernelCoreInit (void)
  294.     {
  295.     eventLibInit ();                    /* VxWorks events */
  296.     semBLibInit ();                     /* binary semaphores */
  297.     semMLibInit ();                     /* mutex semaphores */
  298.     semCLibInit ();                     /* counting semaphores */
  299.     msgQLibInit ();                     /* message queues */
  300.     wdLibInit ();                       /* watchdog timers */
  301.     taskHookInit ();                    /* user callouts on task creation/deletion/context switch */
  302.     }
  303. /******************************************************************************
  304. *
  305. * usrKernelExtraInit - extended kernel facilities
  306. */
  307. void usrKernelExtraInit (void)
  308.     {
  309.     hashLibInit ();                     /* hash library */
  310.     symLibInit ();                      /* symbol table */
  311.     envLibInit (ENV_VAR_USE_HOOKS);     /* environment variables */
  312.     sigInit ();                         /* signals */
  313.     }
  314. /******************************************************************************
  315. *
  316. * usrIosCoreInit - core I/O system
  317. */
  318. void usrIosCoreInit (void)
  319.     {
  320.     mathSoftInit ();                    /* software fpp support */
  321.     usrBootLineParse (BOOT_LINE_ADRS);  /* parse some boot device configuration info  */
  322.     iosInit (NUM_DRIVERS, NUM_FILES, "/null"); /* IO system */
  323.     ttyDrv ();                          /* terminal driver */
  324.     usrSerialInit ();                   /* SIO component */
  325.     }
  326. /******************************************************************************
  327. *
  328. * usrIosExtraInit - extended I/O system
  329. */
  330. void usrIosExtraInit (void)
  331.     {
  332.     excShowInit ();                     /* exception show routines */
  333.     excInit ();                         /* miscellaneous support task */
  334.     logInit (consoleFd, MAX_LOG_MSGS);  /* message logging */
  335.     pipeDrv ();                         /* pipes */
  336.     stdioInit ();                       /* buffered IO library */
  337.     fioLibInit ();                      /* formatting for printf, scanf, etc. */
  338.     floatInit ();                       /* allow printf and others to format floats correctly */
  339.     }
  340. /******************************************************************************
  341. *
  342. * usrRoot - entry point for post-kernel initialization
  343. */
  344. void usrRoot (char *pMemPoolStart, unsigned memPoolSize)
  345.     {
  346.     usrKernelCoreInit ();               /* core kernel facilities */
  347.     memInit (pMemPoolStart, memPoolSize); /* full featured memory allocator */
  348.     memPartLibInit (pMemPoolStart, memPoolSize); /* core memory partition manager */
  349.     usrMmuInit ();                      /* basic MMU component */
  350.     sysClkInit ();                      /* System clock component */
  351.     selectInit (NUM_FILES);             /* select */
  352.     usrIosCoreInit ();                  /* core I/O system */
  353.     usrKernelExtraInit ();              /* extended kernel facilities */
  354.     usrIosExtraInit ();                 /* extended I/O system */
  355.     usrNetworkInit ();                  /* Initialize the network subsystem */
  356.     selTaskDeleteHookAdd ();            /* install select task delete hook */
  357.     usrToolsInit ();                    /* software development tools */
  358.     cplusCtorsLink ();                  /* run compiler generated initialization functions at system startup */
  359.     usrAppInit ();                      /* call usrAppInit() (in your usrAppInit.c project file) after startup. */
  360.     }