inc.c
Upload User: tzzxrml
Upload Date: 2013-08-22
Package Size: 9106k
Code Size: 13k
Category:

SCM

Development Platform:

C/C++

  1. /*************************************************************************/
  2. /*                                                                       */
  3. /*        Copyright (c) 1993-1998 Accelerated Technology, Inc.           */
  4. /*                                                                       */
  5. /* PROPRIETARY RIGHTS of Accelerated Technology are involved in the      */
  6. /* subject matter of this material.  All manufacturing, reproduction,    */
  7. /* use, and sales rights pertaining to this subject matter are governed  */
  8. /* by the license agreement.  The recipient of this software implicitly  */
  9. /* accepts the terms of the license.                                     */
  10. /*                                                                       */
  11. /*************************************************************************/
  12. /*************************************************************************/
  13. /*                                                                       */
  14. /* FILE NAME                                            VERSION          */
  15. /*                                                                       */
  16. /*      inc.c                                           PLUS  1.3        */
  17. /*                                                                       */
  18. /* COMPONENT                                                             */
  19. /*                                                                       */
  20. /*      IN - Initialization                                              */
  21. /*                                                                       */
  22. /* DESCRIPTION                                                           */
  23. /*                                                                       */
  24. /*      This file contains initialization and setup routines associated  */
  25. /*      with the initialization component.                               */
  26. /*                                                                       */
  27. /* AUTHOR                                                                */
  28. /*                                                                       */
  29. /*      William E. Lamie, Accelerated Technology, Inc.                   */
  30. /*                                                                       */
  31. /* DATA STRUCTURES                                                       */
  32. /*                                                                       */
  33. /*      None                                                             */
  34. /*                                                                       */
  35. /* FUNCTIONS                                                             */
  36. /*                                                                       */
  37. /*      INC_Initialize                      Common system initialization */
  38. /*                                                                       */
  39. /* DEPENDENCIES                                                          */
  40. /*                                                                       */
  41. /*      in_extr.h                           Initialization functions     */
  42. /*      er_extr.h                           Error handling function      */
  43. /*      hi_extr.h                           History functions            */
  44. /*      tc_extr.h                           Thread Control functions     */
  45. /*      mb_extr.h                           Mailbox functions            */
  46. /*      qu_extr.h                           Queue functions              */
  47. /*      pi_extr.h                           Pipe functions               */
  48. /*      sm_extr.h                           Semaphore functions          */
  49. /*      ev_extr.h                           Event group functions        */
  50. /*      pm_extr.h                           Partition memory functions   */
  51. /*      dm_extr.h                           Dynamic memory functions     */
  52. /*      tm_extr.h                           Timer functions              */
  53. /*      io_extr.h                           I/O Driver functions         */
  54. /*                                                                       */
  55. /* HISTORY                                                               */
  56. /*                                                                       */
  57. /*         NAME            DATE                    REMARKS               */
  58. /*                                                                       */
  59. /*      W. Lamie        03-01-1993      Created initial version 1.0      */
  60. /*      D. Lamie        04-19-1993      Verified version 1.0             */
  61. /*      W. Lamie        03-01-1994      Replaced void with VOID,         */
  62. /*                                        resulting in version 1.1       */
  63. /*      R. Pfaff -                                                       */
  64. /*      D. Lamie        03-18-1994      Verified version 1.1             */
  65. /*      M.Q. Qian       04-17-1996      updated to version 1.2           */
  66. /*      M. Trippi       03-20-1998      Moved the INC_Initialize_State   */
  67. /*                                        define values into their own   */
  68. /*                                        in_defs.h include file as part */
  69. /*                                        of SPR455. This creates        */
  70. /*                                        version 1.2a.                  */
  71. /*      M. Trippi       03-24-1998      Released version 1.3.            */
  72. /*                                                                       */
  73. /*************************************************************************/
  74. #define         NU_SOURCE_FILE
  75. #include        "in_defs.h"                 /* Initialization defines    */
  76. #include        "in_extr.h"                 /* Initialization functions  */
  77. #include        "hi_extr.h"                 /* History functions         */
  78. #include        "er_extr.h"                 /* Error handling function   */
  79. #include        "tc_extr.h"                 /* Thread Control functions  */
  80. #include        "mb_extr.h"                 /* Mailbox functions         */
  81. #include        "qu_extr.h"                 /* Queue functions           */
  82. #include        "pi_extr.h"                 /* Pipe functions            */
  83. #include        "sm_extr.h"                 /* Semaphore functions       */
  84. #include        "ev_extr.h"                 /* Event group functions     */
  85. #include        "pm_extr.h"                 /* Partition memory functions*/
  86. #include        "dm_extr.h"                 /* Dynamic memory functions  */
  87. #include        "tm_extr.h"                 /* Timer functions           */
  88. #include        "io_extr.h"                 /* I/O Driver functions      */
  89. /* Define global variable that contains the state of initialization.  This 
  90.    flag is for information use only.  */
  91.    
  92. INT             INC_Initialize_State;
  93. /* Define external functions that access the release and license 
  94.    information.  */
  95.    
  96. CHAR    *RLC_Release_Information(VOID);
  97. CHAR    *LIC_License_Information(VOID);
  98. /*************************************************************************/
  99. /*                                                                       */
  100. /* FUNCTION                                                              */
  101. /*                                                                       */
  102. /*      INC_Initialize                                                   */
  103. /*                                                                       */
  104. /* DESCRIPTION                                                           */
  105. /*                                                                       */
  106. /*      This function is the main initialization function of the system. */
  107. /*      All components are initialized by this function.  After system   */
  108. /*      initialization is complete, the Application_Initialize routine   */
  109. /*      is called.  After all initialization is complete, this function  */
  110. /*      calls TCT_Schedule to start scheduling tasks.                    */
  111. /*                                                                       */
  112. /* AUTHOR                                                                */
  113. /*                                                                       */
  114. /*      William E. Lamie, Accelerated Technology, Inc.                   */
  115. /*                                                                       */
  116. /* CALLED BY                                                             */
  117. /*                                                                       */
  118. /*      INT_Initialize                      Target dependent initialize  */
  119. /*                                                                       */
  120. /* CALLS                                                                 */
  121. /*                                                                       */
  122. /*      Application_Initialize              Application initialize       */
  123. /*      RLC_Release_Information             Release information          */
  124. /*      LIC_License_Information             License information          */
  125. /*      ERI_Initialize                      Error handling initialize    */
  126. /*      HII_Initialize                      History initialization       */
  127. /*      TCI_Initialize                      Thread control initialize    */
  128. /*      MBI_Initialize                      Mailbox initialize           */
  129. /*      QUI_Initialize                      Queue initialize             */
  130. /*      PII_Initialize                      Pipe initialize              */
  131. /*      SMI_Initialize                      Semaphore initialize         */
  132. /*      EVI_Initialize                      Event flag initialize        */
  133. /*      PMI_Initialize                      Partition memory initialize  */
  134. /*      DMI_Initialize                      Dynamic memory initialize    */
  135. /*      TMI_Initialize                      Timer initialize             */
  136. /*      IOI_Initialize                      I/O Driver initialize        */
  137. /*      TCT_Schedule                        Thread scheduling loop       */
  138. /*                                                                       */
  139. /* INPUTS                                                                */
  140. /*                                                                       */
  141. /*      first_available_memory              Pointer to available memory  */
  142. /*                                                                       */
  143. /* OUTPUTS                                                               */
  144. /*                                                                       */
  145. /*      None                                                             */
  146. /*                                                                       */
  147. /* HISTORY                                                               */
  148. /*                                                                       */
  149. /*         NAME            DATE                    REMARKS               */
  150. /*                                                                       */
  151. /*      W. Lamie        03-01-1993      Created initial version 1.0      */
  152. /*      D. Lamie        04-19-1993      Verified version 1.0             */
  153. /*                                                                       */
  154. /*************************************************************************/
  155. VOID  INC_Initialize(VOID  *first_available_memory)
  156. {
  157.     /* Indicate that initialization is starting.  */
  158.     INC_Initialize_State =  INC_START_INITIALIZE;
  159.     /* Call release information function.  */
  160.     RLC_Release_Information();
  161.  
  162.     /* Call license information function.  */
  163.     LIC_License_Information();
  164.     /* Initialize the Error handling (ER) component.  */
  165.     ERI_Initialize();
  166.     /* Initialize the History (HI) component.  */
  167.     HII_Initialize();
  168.     /* Initialize the Thread Control (TC) component.  */
  169.     TCI_Initialize();
  170.     /* Initialize the Mailbox (MB) component. */
  171.     MBI_Initialize();
  172.     
  173.     /* Initialize the Queue (QU) component. */
  174.     QUI_Initialize();
  175.     
  176.     /* Initialize the Pipe (PI) component. */
  177.     PII_Initialize();
  178.     
  179.     /* Initialize the Semaphore (SM) component. */
  180.     SMI_Initialize();
  181.     
  182.     /* Initialize the Event Group (EV) component.  */
  183.     EVI_Initialize();
  184.     /* Initialize the Partition memory (PM) component.  */
  185.     PMI_Initialize();
  186.     /* Initialize the Dynamic memory (DM) component.  */
  187.     DMI_Initialize();
  188.     /* Initialize the Timer (TM) component.  */
  189.     TMI_Initialize();
  190.     /* Initialize the I/O Driver (IO) component.  */
  191.     IOI_Initialize();
  192.     /* Invoke the application-supplied initialization function.  */
  193.     Application_Initialize(first_available_memory);
  194.     
  195.     /* Indicate that initialization is finished.  */
  196.     INC_Initialize_State =  INC_END_INITIALIZE;
  197.     /* Start scheduling threads of execution.  */
  198.     TCT_Schedule();
  199. }