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

VxWorks

开发平台:

C/C++

  1. /* usrKernel.c - wind kernel initialization */
  2. /* Copyright 1992-2001 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01j,30nov01,bwa  Changed INCLUDE_EVENTS to INCLUDE_VXEVENTS (SPR #71920).
  7. 01i,10sep01,bwa  Added eventLibInit().
  8. 01h,12feb98,pr   added trgShowInit routine 
  9. 01g,27jan98,cth  changed INCLUDE_INSTRUMENTATION to INCLUDE_WINDVIEW, removed
  10.  include of wvLib.h
  11. 01f,25jan98,pr   added triggering support
  12. 01e,18sep95,ism  imported conditional include of wvLib.h from bootConfig.c
  13. 01d,28mar95,kkk  moved kernel defines to configAll.h
  14. 01c,07dec93,smb  configuration change for windview
  15. 01b,10nov92,jcf  configuration change for MicroWorks.
  16. 01a,18sep92,jcf  written.
  17. */
  18. /*
  19. DESCRIPTION
  20. This file is used to configure and initialize the Wind kernel.  This file is
  21. included by usrConfig.c.
  22. NOMANUAL
  23. */
  24. #ifndef  __INCusrKernelc
  25. #define  __INCusrKernelc 
  26. /* global variables */
  27. #ifdef INCLUDE_CONSTANT_RDY_Q
  28. BMAP_LIST readyQBMap; /* bit mapped ready queue list array */
  29. #endif /* INCLUDE_CONSTANT_RDY_Q */
  30. /*******************************************************************************
  31. *
  32. * usrKernelInit - configure kernel data structures
  33. *
  34. * NOMANUAL
  35. */
  36. void usrKernelInit (void)
  37.     {
  38. #ifdef  INCLUDE_WINDVIEW
  39.     wvLibInit (); /* initialize windview first, really */
  40. #endif /* INCLUDE_WINDVIEW */
  41.     classLibInit (); /* initialize class (must be first) */
  42.     taskLibInit (); /* initialize task object */
  43. #ifdef INCLUDE_TASK_HOOKS
  44.     taskHookInit (); /* initialize task hook package */
  45. #ifdef INCLUDE_SHOW_ROUTINES
  46.     taskHookShowInit (); /* task hook show routine */
  47. #endif /* INCLUDE_SHOW_ROUTINES */
  48. #endif /* INCLUDE_TASK_HOOKS */
  49. #ifdef INCLUDE_SEM_BINARY
  50.     semBLibInit (); /* initialize binary semaphore */
  51. #endif /* INCLUDE_SEM_BINARY */
  52. #ifdef INCLUDE_SEM_MUTEX
  53.     semMLibInit (); /* initialize mutex semaphore */
  54. #endif /* INCLUDE_SEM_MUTEX */
  55. #ifdef INCLUDE_SEM_COUNTING
  56.     semCLibInit (); /* initialize counting semaphore */
  57. #endif /* INCLUDE_SEM_COUNTING */
  58. #ifdef        INCLUDE_VXEVENTS
  59.     eventLibInit ();
  60. #endif        /* INCLUDE_VXEVENTS */
  61. #ifdef INCLUDE_SEM_OLD
  62.     semOLibInit (); /* initialize VxWorks 4.0 semaphores */
  63. #endif /* INCLUDE_SEM_OLD */
  64. #ifdef INCLUDE_WATCHDOGS
  65.     wdLibInit (); /* initialize watchdog */
  66. #ifdef INCLUDE_SHOW_ROUTINES
  67.     wdShowInit (); /* watchdog object show routine */
  68. #endif /* INCLUDE_SHOW_ROUTINES */
  69. #endif /* INCLUDE_WATCHDOGS */
  70. #ifdef INCLUDE_MSG_Q
  71.     msgQLibInit (); /* initialize message queues */
  72. #ifdef INCLUDE_SHOW_ROUTINES
  73.     msgQShowInit (); /* message queue object show routine */
  74. #endif /* INCLUDE_SHOW_ROUTINES */
  75. #endif /* INCLUDE_MSG_Q */
  76. #ifdef INCLUDE_SHOW_ROUTINES
  77.     classShowInit (); /* class object show routine */
  78.     taskShowInit (); /* task object show routine */
  79.     semShowInit (); /* semaphore object show routine */
  80. #endif /* INCLUDE_SHOW_ROUTINES */
  81.     /* configure the kernel queues */
  82. #ifdef INCLUDE_CONSTANT_RDY_Q
  83.     qInit (&readyQHead, Q_PRI_BMAP, (int)&readyQBMap, 256); /* fixed ready q */
  84. #else
  85.     qInit (&readyQHead, Q_PRI_LIST); /* simple priority ready q */
  86. #endif /* !INCLUDE_CONSTANT_RDY_Q */
  87.     qInit (&activeQHead, Q_FIFO);  /* FIFO queue for active q */
  88.     qInit (&tickQHead, Q_PRI_LIST);  /* simple priority semaphore q*/
  89.     workQInit (); /* queue for deferred work */
  90. #ifdef INCLUDE_TRIGGERING               /* initialize event triggering library */
  91.     trgLibInit ();
  92. #ifdef INCLUDE_SHOW_ROUTINES
  93.     trgShowInit (); /* semaphore object show routine */
  94. #endif /* INCLUDE_SHOW_ROUTINES */
  95. #endif /* INCLUDE_TRIGGERING */
  96.     }
  97. #endif /* __INCusrKernelc */