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

VxWorks

开发平台:

C/C++

  1. /* eventP.h - event log header */
  2. /* Copyright 1994-2001 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 02s,09may02,tcr  Fix for SPR 74987 (add #ifdef __cplusplus)
  7. 02r,31oct01,tcr  add event range for RTI
  8. 02q,18oct01,tcr  add support for VxWorks Events, move to VxWorks 5.5
  9. 02q,27sep01,tcr  Fix SPR 24971 - instrument PPC interrupts
  10. 02p,13sep01,tcr  Fix SPR 29673 - macro for msgQSmLib events
  11. 02o,09sep98,cjtc reverting to byte ordering based on _BYTE_ORDER macro
  12. 02n,04sep98,cjtc porting for ARM architechture
  13. 02m,02sep98,nps  corrected WV2.0 -> T2 merge.
  14. 02l,24aug98,cjtc intEnt logging for PPC is now performed in a single step
  15.  instead of the two-stage approach which gave problems with
  16.  out-of-order timestamps in the event log (SPR 21868)
  17. 02k,17aug98,pr   replaced OBJ_VERIFY check with check on NULL pointer
  18. 02j,08may98,pr   added number of params for EVT_OBJ_SIG macro
  19. 02j,08may98,pr   added argument for wv logging in SIG and SM_MSGQ macros 
  20. 02i,15apr98,cth  added event class WV_CLASS_TASKNAMES_PRESERVE/ON, and call to
  21.  _func_evtLogReserveTaskName
  22. 02h,08apr98,pr   reordered the definition of EVENT_SEMFLUSH and EVENT_SEMDELETE
  23. 02g,07apr98,cjtc added () to EVENT_INT_ENT to prevent problem with macro
  24.  expansion.
  25. 02f,22mar98,pr   modified EVT_CTX_BUF to accept TRG_USER_INDEX events. 
  26.  modified definition of EVENT_SEMFLUSH and EVENT_SEMDELETE.
  27. 02e,04mar98,nps  modified xxx_CLASS_n_ON macros so they can be used by
  28.                  inadequate assmblers.
  29. 02d,17feb98,pr   added number of params to EVT_OBJ macros.
  30. 02c,17feb98,dvs  added events for memory instrumentation. (pr)
  31. 02b,27jan98,cth  removed EVENT_BUFFER, CONFIG, BEGIN, END _SIZE definitions,
  32.  updated copyright
  33. 02a,22jan98,pr   made some macros readable also by the assembly.
  34.  added extra bit to evtAction.
  35.  added EVT_CTX_IDLE, EVT_CTX_NODISP macros.
  36. 01z,12jan98,dbs  added EVENT_NIL and EVENT_VALUE to pseudo-events.
  37. 01y,13dec97,pr   reduced the number of args passed to _func_trgCheck
  38.                  moved some extern declaration in funcBindP.h
  39. 01x,20nov97,pr   added some event triggering defines and modified event 
  40.                  logging macros
  41. 01w,17nov97,cth  added EVENT_CONFIG_SIZE, _BEGIN_SIZE, _END_SIZE, _BUFFER_SIZE
  42. 01v,27oct97,pr   redefined levels as classes. 
  43.  redesigned all the macros for managing classes. 
  44. 01u,28aug97,pr   modified WV_OFF to reflect new levels.
  45. 01t,26aug97,pr   replaced WV_IS_ON with proper LEVEL
  46. 01s,18aug97,pr   added trigger calls.
  47. 01r,24jun97,pr   Added declarations for WindView 2.0 variables
  48.  modified macros to include new variable and triggers
  49. 01q,11Apr96,pr   changed if statement in EVT_OBJ_SM_MSGQ, SPR #6048, #6271
  50. 01p,22feb95,rdc  added EVENT_TASK_STATECHANGE.
  51. 01o,01feb95,rdc  added EVENT_TIMER_SYNC.
  52. 01n,27jan95,rdc  added processor number to EVENT_CONFIG.
  53. 01m,28nov94,rdc  changed 32 bit store macros for x86.
  54. 01l,02nov94,rdc  added protocol revision to EVENT_CONFIG.  
  55.  added lockCnt param to EVT_CTX_TASKINFO.
  56. 01k,02nov94,rdc  added 960 macros.
  57. 01j,27may94,pad  added alignment macros. Corrected some parameter comments.
  58. 01i,14apr94,smb  optimised EVT_OBJ_ macros.
  59. 01h,04mar94,smb  added EVENT_INT_EXIT_K 
  60.  changed parameters for EVENT_WIND_EXIT_NODISPATCH
  61.  removed EVENT_WIND_EXIT_IDLENOT
  62.  level 1 event optimisations
  63.  added macro for shared memory objects
  64. 01h,22feb94,smb  changed typedef EVENT_TYPE to event_t (SPR #3064)
  65. 01g,16feb94,smb  introduced new OBJ_ macros, SPR #2982
  66. 01f,26jan94,smb  redid pseudo events - generated host side
  67. 01e,24jan94,smb  added EVENT_WIND_EXIT_DISPATCH_PI and 
  68.  EVENT_WIND_EXIT_NODISPATCH_PI
  69.  added event logging macros
  70. 01d,17dec93,smb  changed typedef of EVENT_TYPE
  71. 01c,10dec93,smb  modified MAX_LEVEL3_ID to include interrupt events
  72.     renamed EVENT_CLOCK_CONFIG to EVENT_CONFIG
  73. 01b,08dec93,kdl  added include of classLibP.h; made def of OBJ_INST_FUNC
  74.    +smb  conditional on OBJ_INST_RTN; reformatted macro comments;
  75.  made includes and obj macros depend on CPU (i.e. not host).
  76. 01a,07dec93,smb  written.
  77. */
  78. #ifndef __INCeventph
  79. #define __INCeventph
  80. #ifdef __cplusplus
  81. extern "C" {
  82. #endif
  83. /* This file contains all windview event identifiers */
  84. /* Triggering and Windview events definitions and macros. 
  85.  * They correspond to the old levels and are the only classes we 
  86.  * identify for the moment. They are also used by the architecture 
  87.  * dependent files, therefore are defined also for assembly languages.
  88.  */
  89. #ifdef CPU /* only for target, not host */
  90. /* this is used by both WV and TRG */
  91. #define CLASS_NONE     0x00000000 
  92. #define WV_CLASS_1     0x00000001   /* Context Switch */
  93. #define WV_CLASS_2     0x00000003   /* Task State Transition */
  94. #define WV_CLASS_3     0x00000007   /* Object and System Libraries */
  95. #define WV_CLASS_TASKNAMES_PRESERVE 0x00001000
  96. #define WV_ON            0x10000000
  97. #define WV_CLASS_1_ON   0x10000001
  98. #define WV_CLASS_2_ON  0x10000003
  99. #define WV_CLASS_3_ON   0x10000007
  100. #define WV_CLASS_TASKNAMES_PRESERVE_ON 0x10001000
  101. #define TRG_CLASS_1      0x00000001
  102. #define TRG_CLASS_2      0x00000010
  103. #define TRG_CLASS_3      0x00000100
  104. #define TRG_CLASS_4      0x00001000
  105. #define TRG_CLASS_5      0x00010000
  106. #define TRG_CLASS_6      0x01111111
  107. #define TRG_ON           0x10000000
  108. #define TRG_CLASS_1_ON   0x10000001
  109. #define TRG_CLASS_2_ON   0x10000010
  110. #define TRG_CLASS_3_ON   0x10000100
  111. #define TRG_CLASS_4_ON   0x10001000
  112. #define TRG_CLASS_5_ON   0x10010000
  113. #define TRG_CLASS_6_ON   0x11111111
  114. #define TRG_CLASS1_INDEX 0
  115. #define TRG_CLASS2_INDEX 1
  116. #define TRG_CLASS3_INDEX 2
  117. #define TRG_USER_INDEX 3
  118. #define TRG_INT_ENT_INDEX 4
  119. #define TRG_ANY_EVENT_INDEX 5
  120. #define TRG_CONTROL_INDEX 6
  121. #endif /* CPU */
  122. /* types */
  123. #ifndef _ASMLANGUAGE
  124. typedef unsigned short event_t;
  125. #ifdef CPU /* only for target, not host */
  126. #include "private/funcBindP.h"
  127. #include "private/classLibP.h"
  128. #include "private/objLibP.h"
  129. #define ACTION_IS_SET (evtAction != 0)
  130. #define TRG_ACTION_SET                  
  131.         {                               
  132.         evtAction |= 0x0001;             
  133.         TRG_EVTCLASS_SET(TRG_ON);               
  134.         }
  135. #define TRG_ACTION_UNSET                        
  136.         {                               
  137.         TRG_EVTCLASS_UNSET(TRG_ON);             
  138.         evtAction &= ~(0x0001);            
  139.         }
  140. #define TRG_ACTION_IS_SET ( (evtAction&0x00ff) == 0x0001)
  141. #define WV_ACTION_SET                   
  142.         {                               
  143.         evtAction |= 0x0100;             
  144.         WV_EVTCLASS_SET(WV_ON);         
  145.         }
  146. #define WV_ACTION_UNSET                 
  147.         {                               
  148.         WV_EVTCLASS_UNSET(WV_ON);               
  149.         evtAction &= ~(0x0100);            
  150.         }
  151. #define WV_ACTION_IS_SET ( (evtAction&0xff00) == 0x0100)
  152. #define WV_EVTCLASS_IS_SET(class)  ( (wvEvtClass&(class)) == (class))
  153. #define WV_EVTCLASS_SET(class)  (wvEvtClass |= (class))
  154. #define WV_EVTCLASS_UNSET(class)        (wvEvtClass &= ~(class))
  155. #define WV_EVTCLASS_EMPTY   (wvEvtClass = CLASS_NONE)
  156. #define TRG_EVTCLASS_IS_SET(class)  ((trgEvtClass&(class)) == (class))
  157. #define TRG_EVTCLASS_SET(class)  (trgEvtClass |= (class))
  158. #define TRG_EVTCLASS_UNSET(class) (trgEvtClass &= ~(class))
  159. #define TRG_EVTCLASS_EMPTY   (trgEvtClass = CLASS_NONE)
  160. #define TRG_EVTCLASS_IS_EMPTY   (trgEvtClass == CLASS_NONE)
  161. /* needed to handle redefinition of obj_core helpRtn field to instRtn 
  162.  * for instrumented kernel
  163.  */
  164. #ifdef OBJ_INST_RTN
  165. #define OBJ_EVT_RTN(objId)
  166.     (((OBJ_ID)(objId))->pObjClass)->instRtn
  167. #define TASK_EVT_RTN(tId)
  168.     (((OBJ_ID)(&((WIND_TCB *)(tId))->objCore))->pObjClass)->instRtn
  169. #else  /* OBJ_INST_RTN */
  170. #define OBJ_EVT_RTN(objId)
  171.     (((OBJ_ID)(objId))->pObjClass)->helpRtn
  172. #define TASK_EVT_RTN(tId)
  173.     (((OBJ_ID)(&((WIND_TCB *)(tId))->objCore))->pObjClass)->helpRtn
  174. #endif /* OBJ_INST_RTN */
  175. /* event logging macros */
  176. /******************************************************************************
  177. *
  178. * OBJ_INST_FUNC - check if object is instrumented
  179. *
  180. * RETURNS: instrumentation routine if instrumented, otherwise NULL
  181. * NOMANUAL
  182. */
  183. #define OBJ_INST_FUNC(objId, classId)   
  184.     ((objId != NULL) ? (OBJ_EVT_RTN (objId)) : (NULL)) 
  185. /******************************************************************************
  186. *
  187. * TASK_INST_FUNC - check if task is instrumented
  188. *
  189. *
  190. * RETURNS: instrumentation routine if instrumented, otherwise NULL
  191. * NOMANUAL
  192. */
  193. #define TASK_INST_FUNC(tid, classId)  
  194.     (((TASK_ID_VERIFY(tid)) == OK)
  195.      ? (TASK_EVT_RTN (tid)) : (NULL))
  196. /******************************************************************************
  197. *
  198. * EVT_CTX_0 - context switch event logging with event id 
  199. *
  200. * NOMANUAL
  201. */
  202. #define EVT_CTX_0(evtId)                                        
  203.         if (ACTION_IS_SET)
  204.         {                                                       
  205.             if ( WV_EVTCLASS_IS_SET(WV_CLASS_1|WV_ON) )                     
  206.                 ( * _func_evtLogT0) (evtId);                    
  207.             if (TRG_EVTCLASS_IS_SET(TRG_CLASS_1|TRG_ON))
  208. ( * _func_trgCheck) (evtId, TRG_CLASS1_INDEX, NULL, NULL, NULL, NULL, NULL, NULL);                            
  209.         }
  210. /******************************************************************************
  211. *
  212. * EVT_CTX_1 - context switch event logging with one parameter
  213. *
  214. * NOMANUAL
  215. */
  216. #define EVT_CTX_1(evtId, arg)                                   
  217.     if ( ACTION_IS_SET )
  218.         {                                                       
  219.         if ( WV_EVTCLASS_IS_SET(WV_CLASS_1|WV_ON) )                         
  220.             ( * _func_evtLogT1) (evtId, arg);                   
  221.         if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_1|TRG_ON) )                                   
  222. ( * _func_trgCheck) (evtId, TRG_CLASS1_INDEX, NULL, arg, NULL, NULL, NULL, NULL);                            
  223.         }
  224. /******************************************************************************
  225. *
  226. * EVT_CTX_IDLE - log EVENT_WIND_EXIT_IDLE event
  227. *
  228. * This macro stores information into the event buffer if the system is idle.
  229. *
  230. * NOMANUAL
  231. */
  232. #define EVT_CTX_IDLE(evtId, arg1)                            
  233.      if ( ACTION_IS_SET && (Q_FIRST (arg1) == NULL))
  234.         {                                                       
  235.         if (WV_EVTCLASS_IS_SET(WV_CLASS_1|WV_ON))         
  236.             (* _func_evtLogT0) (evtId);                 
  237.         if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_1|TRG_ON) )                  
  238. ( * _func_trgCheck) (evtId, TRG_CLASS1_INDEX, NULL, NULL, NULL, NULL, NULL, NULL);      
  239.         }  
  240. /******************************************************************************
  241. *
  242. * EVT_CTX_DISP - context switch event logging for reschedule 
  243. *
  244. * This macro stores information into the event buffer about rescheduling tasks
  245. * in the system. In order to determine the right event type, it first checks the
  246. * two last args. It is used to log the DISPATCH event. Therefore the two last args 
  247. * are the current priority and the normal priority.
  248. *
  249. * NOMANUAL
  250. */
  251. #define EVT_CTX_DISP(evtId, arg1, arg2, arg3)                            
  252.     if ( ACTION_IS_SET )
  253.         {                                                       
  254.         if (arg3 > arg2)                                                
  255.     {                                                           
  256.             if (WV_EVTCLASS_IS_SET(WV_CLASS_1|WV_ON))         
  257.                 (* _func_evtLogTSched) (EVENT_WIND_EXIT_DISPATCH_PI, arg1, arg2);     
  258.             if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_1|TRG_ON) )                  
  259. ( * _func_trgCheck) (EVENT_WIND_EXIT_DISPATCH_PI, TRG_CLASS1_INDEX, NULL, arg1, arg2, NULL, NULL, NULL);      
  260.     }                                                           
  261.     else                                                        
  262.     {                                                           
  263.             if (WV_EVTCLASS_IS_SET(WV_CLASS_1|WV_ON))         
  264.                 (* _func_evtLogTSched) (EVENT_WIND_EXIT_DISPATCH, arg1, arg2);     
  265.             if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_1|TRG_ON) )                  
  266. ( * _func_trgCheck) (EVENT_WIND_EXIT_DISPATCH, TRG_CLASS1_INDEX, NULL, arg1, arg2, NULL, NULL, NULL);      
  267.     }                                                           
  268.         }  
  269. /******************************************************************************
  270. *
  271. * EVT_CTX_NODISP - context switch event logging for reschedule 
  272. *
  273. * This macro stores information into the event buffer about rescheduling tasks
  274. * in the system. In order to determine the right event type, it first checks the
  275. * two last args. It is used to log the NODISPATCH event. Therefore the two last 
  276. * args are the current priority and the normal priority.
  277. *
  278. * NOMANUAL
  279. */
  280. #define EVT_CTX_NODISP(arg1, arg2, arg3)                            
  281.     if (ACTION_IS_SET)                                                      
  282.         {                                                               
  283.         if (arg3 > arg2)                                                
  284.     {                                                           
  285.             if (WV_EVTCLASS_IS_SET(WV_CLASS_1|WV_ON))         
  286.                 (* _func_evtLogTSched) (EVENT_WIND_EXIT_NODISPATCH_PI, arg1, arg2);
  287.             if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_1|TRG_ON) )
  288. ( * _func_trgCheck) (EVENT_WIND_EXIT_NODISPATCH_PI, TRG_CLASS1_INDEX, NULL, arg1, arg2, NULL, NULL, NULL);                            
  289.     }                                                           
  290.     else                                                        
  291.     {                                                           
  292.             if (WV_EVTCLASS_IS_SET(WV_CLASS_1|WV_ON))         
  293.                (* _func_evtLogTSched) (EVENT_WIND_EXIT_NODISPATCH, arg1, arg2);
  294.             if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_1|TRG_ON) )
  295. ( * _func_trgCheck) (EVENT_WIND_EXIT_NODISPATCH, TRG_CLASS1_INDEX, NULL, arg1, arg2, NULL, NULL, NULL);                            
  296.     }                                                           
  297.         }
  298. /******************************************************************************
  299. *
  300. * EVT_CTX_TASKINFO - context switch event logging with task information
  301. *
  302. * This macro stores information into the event buffer about a task
  303. * in the system.
  304. *
  305. * NOMANUAL
  306. */
  307. #define EVT_CTX_TASKINFO(evtId, state, pri, lockCnt, tid, name)              
  308.     if ( ACTION_IS_SET )      
  309.         {                                                             
  310.         if ( WV_EVTCLASS_IS_SET(WV_CLASS_1|WV_ON) )                          
  311.     {      
  312.             ( * _func_evtLogString) (evtId, state, pri, lockCnt, tid, name); 
  313.      
  314.     if (WV_EVTCLASS_IS_SET(WV_CLASS_TASKNAMES_PRESERVE))      
  315.         ( * _func_evtLogReserveTaskName) (evtId, state, pri, lockCnt, tid, name);                  
  316.     }      
  317.         if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_1|TRG_ON) )                                  
  318. ( * _func_trgCheck) (evtId, TRG_CLASS1_INDEX, NULL, state, pri, lockCnt, tid, name);                            
  319.         }
  320. /******************************************************************************
  321. *
  322. * EVT_CTX_BUF - context switch event logging which logs a buffer,
  323. *
  324. * This macro stores eventpoint and user events into the event buffer.
  325. *
  326. * NOMANUAL
  327. */
  328. #define EVT_CTX_BUF(evtId, addr, bufSize, BufferAddr)
  329.     if ( ACTION_IS_SET )
  330.         {                                                               
  331.         if ( WV_EVTCLASS_IS_SET(WV_CLASS_1|WV_ON) )                                  
  332.              ( * _func_evtLogPoint) (evtId, addr, bufSize, BufferAddr); 
  333.         if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_4|TRG_ON) )                                   
  334. ( * _func_trgCheck) (evtId, TRG_USER_INDEX, NULL, addr, bufSize, BufferAddr, NULL, NULL);                            
  335.         }
  336. /******************************************************************************
  337. *
  338. * EVT_TASK_0 - task state transition event logging with event id.
  339. *
  340. *
  341. * NOMANUAL
  342. */
  343. #define EVT_TASK_0(evtId)                                       
  344.     if ( ACTION_IS_SET )
  345.         {                                                       
  346.         if ( WV_EVTCLASS_IS_SET(WV_CLASS_2|WV_ON) )                         
  347.             (* _func_evtLogM0) (evtId);                         
  348.         if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_2|TRG_ON) )                                   
  349. ( * _func_trgCheck) (evtId, TRG_CLASS2_INDEX, NULL, NULL, NULL, NULL, NULL, NULL);                            
  350.         }
  351. /******************************************************************************
  352. *
  353. * EVT_TASK_1 - task state transition event logging with one argument.
  354. *
  355. *
  356. * NOMANUAL
  357. */
  358. #define EVT_TASK_1(evtId, arg)                                  
  359.   do 
  360.    { 
  361.     if ( ACTION_IS_SET )
  362.         {                                                       
  363.         if ( WV_EVTCLASS_IS_SET(WV_CLASS_2|WV_ON) )                         
  364.             (* _func_evtLogM1) (evtId, arg);                    
  365.         if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_2|TRG_ON) )                                   
  366. ( * _func_trgCheck) (evtId, TRG_CLASS2_INDEX, NULL, arg, NULL, NULL, NULL, NULL);                            
  367.         }  
  368.    } while (0)
  369. /******************************************************************************
  370. *
  371. * EVT_TASK_2 - task state transition event logging with two arguments.
  372. *
  373. *
  374. * NOMANUAL
  375. */
  376. #define EVT_TASK_2(evtId, arg1, arg2)                           
  377.     if ( ACTION_IS_SET )
  378.         {                                                       
  379.         if ( WV_EVTCLASS_IS_SET(WV_CLASS_2|WV_ON) )                         
  380.             (* _func_evtLogM2) (evtId, arg1, arg2);             
  381.         if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_2|TRG_ON) )                                   
  382. ( * _func_trgCheck) (evtId, TRG_CLASS2_INDEX, NULL, arg1, arg2, NULL, NULL, NULL);                            
  383.         }
  384. /******************************************************************************
  385. *
  386. * EVT_TASK_3 - task state transition event logging with three arguments.
  387. *
  388. *
  389. * NOMANUAL
  390. */
  391. #define EVT_TASK_3(evtId, arg1, arg2, arg3)                     
  392.     if ( ACTION_IS_SET )
  393.         {                                                       
  394.         if ( WV_EVTCLASS_IS_SET(WV_CLASS_2|WV_ON) )                         
  395.             (* _func_evtLogM3) (evtId, arg1, arg2, arg3);       
  396.         if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_2|TRG_ON) )                                   
  397. ( * _func_trgCheck) (evtId, TRG_CLASS2_INDEX, NULL, arg1, arg2, arg3, NULL, NULL);                            
  398.         }
  399. /******************************************************************************
  400. *
  401. * EVT_OBJ_6 - object status event logging with six arguments.
  402. *
  403. *
  404. * NOMANUAL
  405. */
  406. #define EVT_OBJ_6(objType, objId, objClassId, evtId, arg1, arg2, arg3,  
  407.      arg4, arg5, arg6)
  408.     if ( ACTION_IS_SET )
  409.         {                                                               
  410.         if ( WV_EVTCLASS_IS_SET(WV_CLASS_3|WV_ON) )                                 
  411.             {                                                           
  412.             VOIDFUNCPTR __evtRtn__;                                     
  413.             if ((__evtRtn__ = (objType##_INST_FUNC(objId,objClassId))) != NULL)
  414.                 (* __evtRtn__) (evtId, 6, arg1, arg2, arg3, arg4, arg5, arg6);
  415.             }                                                           
  416.         if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_3|TRG_ON) )                                   
  417. ( * _func_trgCheck) (evtId, TRG_CLASS3_INDEX, objId, arg1, arg2, arg3, arg4, arg5);                            
  418.         }
  419. /******************************************************************************
  420. *
  421. * EVT_OBJ_5 - object status event logging with five arguments.
  422. *
  423. *
  424. * NOMANUAL
  425. */
  426. #define EVT_OBJ_5(objType, objId, objClassId, evtId, arg1, arg2, arg3,  
  427.      arg4, arg5)
  428.    if ( ACTION_IS_SET )
  429.         {                                                               
  430.         if ( WV_EVTCLASS_IS_SET(WV_CLASS_3|WV_ON) )                                 
  431.             {                                                           
  432.             VOIDFUNCPTR __evtRtn__;                                     
  433.             if ((__evtRtn__ = (objType##_INST_FUNC(objId,objClassId))) != NULL)
  434.                 (* __evtRtn__) (evtId, 5, arg1, arg2, arg3, arg4, arg5);   
  435.             }                                                           
  436.         if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_3|TRG_ON) )                                    
  437. ( * _func_trgCheck) (evtId, TRG_CLASS3_INDEX, objId, arg1, arg2, arg3, arg4, arg5);                            
  438.         }
  439. /******************************************************************************
  440. *
  441. * EVT_OBJ_4 - object status event logging with four arguments.
  442. *
  443. *
  444. * NOMANUAL
  445. */
  446. #define EVT_OBJ_4(objType, objId, objClassId, evtId, arg1, arg2, arg3, arg4)
  447.     if ( ACTION_IS_SET )
  448.         {                                                               
  449.         if ( WV_EVTCLASS_IS_SET(WV_CLASS_3|WV_ON) )                                 
  450.             {                                                           
  451.                         VOIDFUNCPTR __evtRtn__; 
  452.             if ((__evtRtn__ = (objType##_INST_FUNC(objId,objClassId))) != NULL)
  453.                 (* __evtRtn__) (evtId, 4, arg1, arg2, arg3, arg4);         
  454.             }                                                           
  455.         if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_3|TRG_ON) )                                    
  456. ( * _func_trgCheck) (evtId, TRG_CLASS3_INDEX, objId, arg1, arg2, arg3, arg4, NULL);                            
  457.         }
  458. /******************************************************************************
  459. *
  460. * EVT_OBJ_3 - object status event logging with three arguments.
  461. *
  462. *
  463. * NOMANUAL
  464. */
  465. #define EVT_OBJ_3(objType, objId, objClassId, evtId, arg1, arg2, arg3)  
  466.     if ( ACTION_IS_SET )
  467.         {                                                               
  468.         if ( WV_EVTCLASS_IS_SET(WV_CLASS_3|WV_ON) )                                 
  469.             {                                                           
  470.                         VOIDFUNCPTR __evtRtn__; 
  471.             if ((__evtRtn__ = (objType##_INST_FUNC(objId,objClassId))) != NULL)
  472.                 (* __evtRtn__) (evtId, 3, arg1, arg2, arg3);               
  473.             }                                                           
  474.         if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_3|TRG_ON) )                                    
  475. {
  476. ( * _func_trgCheck) (evtId, TRG_CLASS3_INDEX, objId, arg1, arg2, arg3, NULL, NULL);                            
  477.         }
  478.         }
  479. /******************************************************************************
  480. *
  481. * EVT_OBJ_2 - object status event logging with two arguments.
  482. *
  483. *
  484. * NOMANUAL
  485. */
  486. #define EVT_OBJ_2(objType, objId, objClassId, evtId, arg1, arg2)        
  487.     if ( ACTION_IS_SET )                
  488.         {                                                                      
  489.         if ( WV_EVTCLASS_IS_SET(WV_CLASS_3|WV_ON) )                                     
  490.             {                                                                  
  491.             VOIDFUNCPTR __evtRtn__;                                            
  492.             if ((__evtRtn__ = (objType##_INST_FUNC(objId,objClassId))) != NULL)
  493.                 (* __evtRtn__)(evtId, 2, arg1, arg2);                             
  494.             }                                                                  
  495.         if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_3|TRG_ON) )                         
  496. ( * _func_trgCheck) (evtId, TRG_CLASS3_INDEX, objId, arg1, arg2, NULL, NULL, NULL);                            
  497.         }
  498. /******************************************************************************
  499. *
  500. * EVT_OBJ_1 - object status event logging with an argument.
  501. *
  502. *
  503. * NOMANUAL
  504. */
  505. #define EVT_OBJ_1(objType, objId, objClassId, evtId, arg1)
  506.     if ( ACTION_IS_SET )
  507.         {                                                               
  508.         if ( WV_EVTCLASS_IS_SET(WV_CLASS_3|WV_ON) )                                 
  509.             {                                                           
  510.                         VOIDFUNCPTR __evtRtn__; 
  511.             if ((__evtRtn__ = (objType##_INST_FUNC(objId,objClassId))) != NULL)
  512.                 (* __evtRtn__) (evtId, 1, arg1);                           
  513.             }                                                           
  514.         if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_3|TRG_ON) )                                    
  515. ( * _func_trgCheck) (evtId, TRG_CLASS3_INDEX, objId, arg1, NULL, NULL, NULL, NULL);                            
  516.         }
  517. /******************************************************************************
  518. *
  519. * EVT_OBJ_TASKSPAWN - object status event logging for a spawned task.
  520. *
  521. *
  522. * NOMANUAL
  523. */
  524. #define EVT_OBJ_TASKSPAWN(evtId, arg1, arg2, arg3, arg4, arg5)  
  525.     if ( ACTION_IS_SET )
  526.         {                                                               
  527.         if ( WV_EVTCLASS_IS_SET(WV_CLASS_3|WV_ON) )                                 
  528.               ( * _func_evtLogOIntLock) (evtId, 5, arg1, arg2, arg3, arg4, arg5); 
  529.         if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_3|TRG_ON) )                                    
  530. ( * _func_trgCheck) (evtId, TRG_CLASS3_INDEX, NULL, arg1, arg2, arg3, arg4, arg5);                            
  531.         }
  532. /******************************************************************************
  533. *
  534. * EVT_OBJ_SIG - signal event logging
  535. *
  536. *
  537. * NOMANUAL
  538. */
  539. #define EVT_OBJ_SIG(evtId, nParam, arg1, arg2)
  540.     if ( ACTION_IS_SET )
  541.         {                                                               
  542.         if ( WV_EVTCLASS_IS_SET(WV_CLASS_3|WV_ON) )                                  
  543.                         if (sigEvtRtn != NULL) 
  544.                                 (* sigEvtRtn) (evtId, nParam, arg1, arg2); 
  545.         if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_3|TRG_ON) )                                     
  546. ( * _func_trgCheck) (evtId, TRG_CLASS3_INDEX, NULL, arg1, arg2, NULL, NULL, NULL);                            
  547.         }
  548. /******************************************************************************
  549. *
  550. * EVT_OBJ_EVENT - events (from eventLib) event logging
  551. *
  552. *
  553. * NOMANUAL
  554. */
  555. #define EVT_OBJ_EVENT(evtId, nParam, arg1, arg2, arg3)                 
  556.     if ( ACTION_IS_SET )         
  557.         {                                                               
  558.         if ( WV_EVTCLASS_IS_SET(WV_CLASS_3|WV_ON) )                     
  559.             if (eventEvtRtn != NULL)                                    
  560.                 (* eventEvtRtn) (evtId, nParam, arg1, arg2, arg3);      
  561.         if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_3|TRG_ON) )                  
  562. ( * _func_trgCheck) (evtId, TRG_CLASS3_INDEX, NULL,     
  563.                                      arg1, arg2, arg3, NULL, NULL);     
  564.         }
  565. /******************************************************************************
  566. *
  567. * INST_SIG_INSTALL - install event logging routine for signals
  568. *
  569. *
  570. * NOMANUAL
  571. */
  572. #define INST_SIG_INSTALL
  573.     if ( ACTION_IS_SET )
  574.         {                                                       
  575.         if ( WV_EVTCLASS_IS_SET(WV_CLASS_3|WV_ON) )                         
  576.             {                                                   
  577.                 sigEvtRtn = _func_evtLogOIntLock;               
  578.             else                                                
  579.                 sigEvtRtn = NULL;                               
  580.             }                                                   
  581.         }
  582. /******************************************************************************
  583. *
  584. * EVT_OBJ_SM_MSGQ - object status event logging for SMO message queues.
  585. *
  586. *
  587. * NOMANUAL
  588. */
  589. #define EVT_OBJ_SM_MSGQ(evtId, arg1, arg2, arg3, arg4, arg5, arg6)     
  590.     if ( ACTION_IS_SET )
  591.         {                                                               
  592.         if ( WV_EVTCLASS_IS_SET(WV_CLASS_3|WV_ON) )                                 
  593.                 (* _func_evtLogOIntLock) (evtId, arg6, arg1, arg2, arg3,  
  594.                                           arg4, arg5);        
  595.         if ( TRG_EVTCLASS_IS_SET(TRG_CLASS_3|TRG_ON) )                                      
  596. ( * _func_trgCheck) (evtId, TRG_CLASS3_INDEX, arg1, arg2, arg3, arg4, arg5);                            
  597.         }
  598. #endif /* CPU */ /* end target-only section */
  599. #endif  /* _ASMLANGUAGE */
  600. #define WV_REV_ID_T2 0xb0b00000
  601. #define WV_REV_ID_T3 0xcdcd0000
  602. #define WV_EVT_PROTO_REV_1_0_FCS 1
  603. #define WV_EVT_PROTO_REV_2_0_FCS 2
  604. #define WV_EVT_PROTO_REV_3_0_FCS 3
  605. #define WV_EVT_PROTO_REV_3_1_FCS 4
  606. #define WV_EVT_PROTO_REV_2_2_FCS 5
  607. #define WV_REV_ID_CURRENT WV_REV_ID_T2
  608. #define WV_EVT_PROTO_REV_CURRENT WV_EVT_PROTO_REV_2_2_FCS
  609. /* ranges for the different classes of events */
  610. #define MIN_CONTROL_ID  0
  611. #define MAX_CONTROL_ID 49
  612. #define MIN_CLASS1_ID 50
  613. #define MAX_CLASS1_ID 599
  614. #define MIN_INT_ID 102
  615. #define PPC_DECR_INT_ID 599
  616. #define MAX_INT_ID 599
  617. #define MIN_CLASS2_ID 600
  618. #define MAX_CLASS2_ID 9999
  619. #define MIN_CLASS3_ID 10000
  620. #define MAX_CLASS3_ID 19999 
  621. #define MIN_RESERVE_ID 20000
  622. #define MIN_RTI_RESERVE_ID      39900
  623. #define MAX_RTI_RESERVE_ID      39999
  624. #define MAX_RESERVE_ID 39999 
  625. #define MIN_USER_ID 40000
  626. #define MAX_USER_ID 65535
  627. #define INT_LEVEL(eventNum) ((eventNum)-MIN_INT_ID)
  628. #define IS_CLASS1_EVENT(event) 
  629.     ((event >= MIN_CLASS1_ID) && (event <= MAX_CLASS1_ID))
  630. #define IS_CLASS2_EVENT(event) 
  631.     ((event >= MIN_CLASS2_ID) && (event <= MAX_CLASS2_ID))
  632. #define IS_CLASS3_EVENT(event) 
  633.     ((event >= MIN_CLASS3_ID) && (event <= MAX_CLASS3_ID))
  634. #define IS_INT_ENT_EVENT(event) 
  635.     ((event >= MIN_INT_ID) && (event <= MAX_INT_ID))
  636. #define IS_CONTROL_EVENT(event) 
  637.     ((event >= MIN_CONTROL_ID) && (event <= MAX_CONTROL_ID))
  638. #define IS_USER_EVENT(event) 
  639.     ((event >= MIN_USER_ID) && (event <= MAX_USER_ID))
  640. #define CONTROL_EVENT(id) (MIN_CONTROL_ID + id)
  641. #define CLASS1_EVENT(id)  (MIN_CLASS1_ID + id)
  642. #define CLASS2_EVENT(id)  (MIN_CLASS2_ID + id)
  643. #define CLASS3_EVENT(id)  (MIN_CLASS3_ID + id)
  644. #define INT_EVENT(id)     (MIN_INT_ID + id)
  645. /* EVENT Id's */
  646. /* Interrupt events */
  647. #define EVENT_INT_ENT(k)  ((k) + MIN_INT_ID)
  648.     /* Param:
  649.      *   short EVENT_INT_ENT(k), 
  650.      *   int timeStamp
  651.      */
  652. #define EVENT_INT_EXIT    (MIN_INT_ID - 1)
  653.     /* Param:
  654.      *   short EVENT_INT_EXIT, 
  655.      *   int timeStamp
  656.      */
  657. #define EVENT_INT_EXIT_K                (MIN_INT_ID - 2)
  658.     /* Param:
  659.      *   short EVENT_INT_EXIT_K,
  660.      *   int timeStamp
  661.      */
  662. /* Control events */
  663. #define EVENT_BEGIN                     CONTROL_EVENT(0)
  664.     /* Param:
  665.      *   short EVENT_BEGIN, 
  666.      *   int CPU, 
  667.      *   int bspSize, 
  668.      *   char * bspName, 
  669.      *   int taskIdCurrent, 
  670.      *   int collectionMode, 
  671.      *   int revision
  672.      */
  673. #define EVENT_END                       CONTROL_EVENT(1)
  674.     /* Param:
  675.      *   short EVENT_END
  676.      */
  677. #define EVENT_TIMER_ROLLOVER            CONTROL_EVENT(2)
  678.     /* Param:
  679.      *   short EVENT_TIMER_ROLLOVER
  680.      *   int timeStamp, 
  681.      */
  682. #define EVENT_TASKNAME CONTROL_EVENT(3)
  683.     /* Param:
  684.      *   short EVENT_TASKNAME, 
  685.      *   int status, 
  686.      *   int priority, 
  687.      *   int taskLockCount
  688.      *   int tid, 
  689.      *   int nameSize, 
  690.      *   char * name
  691.      */
  692. #define EVENT_CONFIG               CONTROL_EVENT(4)
  693.     /* Param:
  694.      *   int revision,                  WV_REV_ID | WV_EVT_PROTO_REV
  695.      *   int timestampFreq, 
  696.      *   int timestampPeriod, 
  697.      *   int autoRollover, 
  698.      *   int clkRate,
  699.      *   int collectionMode,
  700.      *   int processorNum
  701.      */
  702. #define EVENT_BUFFER                    CONTROL_EVENT(5)
  703.     /* Param:
  704.      *   short EVENT_BUFFER,
  705.      *   int taskIdCurrent
  706.      */
  707. #define EVENT_TIMER_SYNC CONTROL_EVENT(6)
  708.     /* Param:
  709.      *   int timeStamp,
  710.      *   int spare
  711.      */
  712. #define EVENT_LOGCOMMENT              CONTROL_EVENT(7)
  713.      /* Param:
  714.       *   int length
  715.       *   string comment
  716.       */
  717. #define EVENT_ANY_EVENT CONTROL_EVENT(48)
  718.     /* This is added for triggering, when no particular event is required */
  719. /* CLASS3 events */
  720. #define EVENT_TASKSPAWN CLASS3_EVENT(0)
  721.     /* Param:
  722.      *   short EVENT_TASKSPAWN, 
  723.      *   int timeStamp, 
  724.      *   int options, 
  725.      *   int entryPt, 
  726.      *   intstackSize, 
  727.      *   int priority, 
  728.      *   int pTcb
  729.      */
  730. #define EVENT_TASKDESTROY CLASS3_EVENT(1)
  731.     /* Param:
  732.      *    short EVENT_TASKDESTROY, 
  733.      *    int timeStamp, 
  734.      *    int safeCnt, 
  735.      *    int pTcb
  736.      */
  737. #define EVENT_TASKDELAY CLASS3_EVENT(2)
  738.     /* Param:
  739.      *   short EVENT_TASKDELAY, 
  740.      *   int timeStamp, 
  741.      *   int ticks
  742.      */
  743. #define EVENT_TASKPRIORITYSET CLASS3_EVENT(3)
  744.     /* Param:
  745.      *   short EVENT_TASKPRIORITYSET, 
  746.      *   int timeStamp, 
  747.      *   int oldPri, 
  748.      *   int newPri, 
  749.      *   int pTcb
  750.      */
  751. #define EVENT_TASKSUSPEND CLASS3_EVENT(4)
  752.     /* Param:
  753.      *   short EVENT_TASKSUSPEND, 
  754.      *   int timeStamp, 
  755.      *   int pTcb
  756.      */
  757. #define EVENT_TASKRESUME CLASS3_EVENT(5)
  758.     /* Param:
  759.      *   short EVENT_TASKRESUME, 
  760.      *   int timeStamp, 
  761.      *   int priority, 
  762.      *   int pTcb
  763.      */
  764. #define EVENT_TASKSAFE CLASS3_EVENT(6)
  765.     /* Param:
  766.      *   short EVENT_TASKSAFE, 
  767.      *   int timeStamp, 
  768.      *   int safeCnt, 
  769.      *   int tid
  770.      */
  771. #define EVENT_TASKUNSAFE CLASS3_EVENT(7)
  772.     /* Param:
  773.      *   short EVENT_TASKUNSAFE, 
  774.      *   int timeStamp, 
  775.      *   int safeCnt, 
  776.      *   int tid
  777.      */
  778. #define EVENT_SEMBCREATE CLASS3_EVENT(8)
  779.     /* Param:
  780.      *   short EVENT_SEMBCREATE, 
  781.      *   int timeStamp, 
  782.      *   int semOwner, 
  783.      *   int options, 
  784.      *   int semId
  785.      */
  786. #define EVENT_SEMCCREATE CLASS3_EVENT(9)
  787.     /* Param:
  788.      *   short EVENT_SEMCCREATE, 
  789.      *   int timeStamp, 
  790.      *   int initialCount, 
  791.      *   int options, 
  792.      *   int semId
  793.      */
  794. #define EVENT_SEMDELETE CLASS3_EVENT(10)
  795.     /* Param:
  796.      *   short EVENT_SEMDELETE, 
  797.      *   int timeStamp, 
  798.      *   int qHead
  799.      *   int recurse
  800.      *   int state
  801.      *   int semId
  802.      */
  803. #define EVENT_SEMFLUSH CLASS3_EVENT(11)
  804.     /* Param:
  805.      *   short EVENT_SEMFLUSH, 
  806.      *   int timeStamp, 
  807.      *   int qHead
  808.      *   int recurse
  809.      *   int state
  810.      *   int semId
  811.      */
  812. #define EVENT_SEMGIVE CLASS3_EVENT(12)
  813.     /* Param:
  814.      *   short EVENT_SEMGIVE, 
  815.      *   int timeStamp, 
  816.      *   int recurse, 
  817.      *   int semOwner, 
  818.      *   int semId
  819.      */
  820. #define EVENT_SEMMCREATE CLASS3_EVENT(13)
  821.     /* Param:
  822.      *   short EVENT_SEMMCREATE, 
  823.      *   int timeStamp, 
  824.      *   int semOwner, 
  825.      *   int options, 
  826.      *   int semId
  827.      */
  828. #define EVENT_SEMMGIVEFORCE CLASS3_EVENT(14)
  829.     /* Param:
  830.      *   short EVENT_SEMMGIVEFORCE, 
  831.      *   int timeStamp, 
  832.      *   int semOwner, 
  833.      *   int options, 
  834.      *   int semId
  835.      */
  836. #define EVENT_SEMTAKE CLASS3_EVENT(15)
  837.     /* Param:
  838.      *   short EVENT_SEMTAKE, 
  839.      *   int timeStamp, 
  840.      *   int recurse, 
  841.      *   int semOwner, 
  842.      *   int semId
  843.      */
  844. #define EVENT_WDCREATE CLASS3_EVENT(16)
  845.     /* Param:
  846.      *   short EVENT_WDCREATE, 
  847.      *   int timeStamp, 
  848.      *   int wdId
  849.      */
  850. #define EVENT_WDDELETE CLASS3_EVENT(17)
  851.     /* Param:
  852.      *   short EVENT_WDDELETE, 
  853.      *   int timeStamp, 
  854.      *   int wdId
  855.      */
  856. #define EVENT_WDSTART CLASS3_EVENT(18)
  857.     /* Param:
  858.      *   short EVENT_WDSTART, 
  859.      *   int timeStamp, 
  860.      *   int delay, 
  861.      *   int wdId
  862.      */
  863. #define EVENT_WDCANCEL CLASS3_EVENT(19)
  864.     /* Param:
  865.      *   short EVENT_WDCANCEL, 
  866.      *   int timeStamp, 
  867.      *   int wdId
  868.      */
  869. #define EVENT_MSGQCREATE CLASS3_EVENT(20)
  870.     /* Param:
  871.      *   short EVENT_MSGQCREATE, 
  872.      *   int timeStamp, 
  873.      *   int options, 
  874.      *   int maxMsgLen, 
  875.      *   int maxMsg, 
  876.      *   int msgId
  877.      */
  878. #define EVENT_MSGQDELETE CLASS3_EVENT(21)
  879.     /* Param:
  880.      *   short EVENT_MSGQDELETE, 
  881.      *   int timeStamp, 
  882.      *   int msgId
  883.      */
  884. #define EVENT_MSGQRECEIVE CLASS3_EVENT(22)
  885.     /* Param:
  886.      *   short EVENT_MSGQRECEIVE, 
  887.      *   int timeStamp, 
  888.      *   int timeout, 
  889.      *   int bufSize, 
  890.      *   int buffer, 
  891.      *   int msgId
  892.      */
  893. #define EVENT_MSGQSEND CLASS3_EVENT(23)
  894.     /* Param:
  895.      *   short EVENT_MSGQSEND, 
  896.      *   int timeStamp, 
  897.      *   int priority, 
  898.      *   int timeout, 
  899.      *   int bufSize, 
  900.      *   int buffer, 
  901.      *   int msgId
  902.      */
  903. #define EVENT_SIGNAL CLASS3_EVENT(24)
  904.     /* Param:
  905.      *   short EVENT_SIGNAL, 
  906.      *   int timeStamp, 
  907.      *   int handler, 
  908.      *   int signo
  909.      */
  910. #define EVENT_SIGSUSPEND CLASS3_EVENT(25)
  911.     /* Param:
  912.      *   short EVENT_SIGSUSPEND, 
  913.      *   int timeStamp, 
  914.      *   int pSet
  915.      */
  916. #define EVENT_PAUSE CLASS3_EVENT(26)
  917.     /* Param:
  918.      *   short EVENT_PAUSE, 
  919.      *   int timeStamp, 
  920.      *   int tid
  921.      */
  922. #define EVENT_KILL CLASS3_EVENT(27)
  923.     /* Param:
  924.      *   short EVENT_KILL, 
  925.      *   int timeStamp, 
  926.      *   int tid, 
  927.      *   int signo
  928.      */
  929. #define EVENT_SAFE_PEND                         CLASS3_EVENT(28)
  930.     /* Param:
  931.      *   short EVENT_SAFE_PEND, 
  932.      *   int tid
  933.      */
  934. #define EVENT_SIGWRAPPER                        CLASS3_EVENT(29)
  935.     /* Param:
  936.      *   short EVENT_SIGWRAPPER, 
  937.      *   int signo, 
  938.      *   int tid
  939.      */
  940. #define EVENT_MEMALLOC                          CLASS3_EVENT(30)
  941.     /* Param:
  942.      *   int timeStamp,
  943.      *   unsigned nBytes,
  944.      *   unsigned nBytesPlusHeaderAlign,
  945.      *   int pBlock,
  946.      *   int partId
  947.      */
  948. #define EVENT_MEMFREE                           CLASS3_EVENT(31)
  949.     /* Param:
  950.      *   int timeStamp,
  951.      *   unsigned nBytesPlusHeaderAlign,
  952.      *   int pBlock,
  953.      *   int partId
  954.      */
  955. #define EVENT_MEMPARTCREATE                     CLASS3_EVENT(32)
  956.     /* Param:
  957.      *   int timeStamp,
  958.      *   unsigned poolSize,
  959.      *   int partId
  960.      */
  961. #define EVENT_MEMREALLOC                        CLASS3_EVENT(33)
  962.     /* Param:
  963.      *   int timeStamp,
  964.      *   unsigned nBytes,
  965.      *   unsigned nBytesPlusHeaderAlign,
  966.      *   int pBlock,
  967.      *   int partId
  968.      */
  969. #define EVENT_MEMADDTOPOOL                      CLASS3_EVENT(34)
  970.     /* Param:
  971.      *   int timeStamp,
  972.      *   unsigned poolSize,
  973.      *   int partId
  974.      */
  975. #define EVENT_EVENTSEND CLASS3_EVENT(57)
  976.     /* Param:
  977.      *   int taskId,
  978.      *   UINT32 events
  979.      */
  980. #define EVENT_EVENTRECEIVE CLASS3_EVENT(58)
  981.     /* Param:
  982.      *   UINT32 events,
  983.      *   int timeout,
  984.      *   UINT8 flags
  985.      */
  986. /* CLASS2 events */
  987. #define EVENT_WINDSPAWN CLASS2_EVENT(0)
  988.     /* Param:
  989.      *   short EVENT_WINDSPAWN, 
  990.      *   int pTcb, 
  991.      *   int priority
  992.      */
  993. #define EVENT_WINDDELETE CLASS2_EVENT(1)
  994.     /* Param:
  995.      *   short EVENT_WINDDELETE, 
  996.      *   int pTcb
  997.      */
  998. #define EVENT_WINDSUSPEND CLASS2_EVENT(2)
  999.     /* Param:
  1000.      *   short EVENT_WINDSUSPEND, 
  1001.      *   int pTcb
  1002.      */
  1003. #define EVENT_WINDRESUME CLASS2_EVENT(3)
  1004.     /* Param:
  1005.      *   short EVENT_WINDRESUME, 
  1006.      *   int pTcb
  1007.      */
  1008. #define EVENT_WINDPRIORITYSETRAISE CLASS2_EVENT(4)
  1009.     /* Param:
  1010.      *   short EVENT_WINDPRIORITYSETRAISE, 
  1011.      *   int pTcb, 
  1012.      *   int oldPriority, 
  1013.      *   int priority
  1014.      */
  1015. #define EVENT_WINDPRIORITYSETLOWER CLASS2_EVENT(5)
  1016.     /* Param:
  1017.      *   short EVENT_WINDPRIORITYSETLOWER, 
  1018.      *   int pTcb, 
  1019.      *   int oldPriority, 
  1020.      *   int priority
  1021.      */
  1022. #define EVENT_WINDSEMDELETE CLASS2_EVENT(6)
  1023.     /* Param:
  1024.      *   short EVENT_WINDSEMDELETE, 
  1025.      *   int semId
  1026.      */
  1027. #define EVENT_WINDTICKANNOUNCETMRSLC CLASS2_EVENT(7)
  1028.     /* Param:
  1029.      *   short EVENT_WINDTICKANNOUNCETMRSLC
  1030.      */
  1031. #define EVENT_WINDTICKANNOUNCETMRWD CLASS2_EVENT(8)
  1032.     /* Param:
  1033.      *   short EVENT_WINDTICKANNOUNCETMRWD, 
  1034.      *   int wdId
  1035.      */
  1036. #define EVENT_WINDDELAY CLASS2_EVENT(9)
  1037.     /* Param:
  1038.      *   short EVENT_WINDDELAY
  1039.      *   int ticks
  1040.      */
  1041. #define EVENT_WINDUNDELAY CLASS2_EVENT(10)
  1042.     /* Param:
  1043.      *   short EVENT_WINDUNDELAY, 
  1044.      *   int pTcb
  1045.      */
  1046. #define EVENT_WINDWDSTART CLASS2_EVENT(11)
  1047.     /* Param:
  1048.      *   short EVENT_WINDWDSTART, 
  1049.      *   int wdId
  1050.      */
  1051. #define EVENT_WINDWDCANCEL CLASS2_EVENT(12)
  1052.     /* Param:
  1053.      *   short EVENT_WINDWDCANCEL, 
  1054.      *   int wdId
  1055.      */
  1056. #define EVENT_WINDPENDQGET CLASS2_EVENT(13)
  1057.     /* Param:
  1058.      *   short EVENT_WINDPENDQGET, 
  1059.      *   int pTcb
  1060.      */
  1061. #define EVENT_WINDPENDQFLUSH CLASS2_EVENT(14)
  1062.     /* Param:
  1063.      *   short EVENT_WINDPENDQFLUSH, 
  1064.      *   int pTcb
  1065.      */
  1066. #define EVENT_WINDPENDQPUT CLASS2_EVENT(15)
  1067.     /* Param:
  1068.      *   short EVENT_WINDPENDQPUT
  1069.      */
  1070. #define EVENT_WINDPENDQTERMINATE CLASS2_EVENT(17)
  1071.     /* Param:
  1072.      *   short EVENT_WINDPENDQTERMINATE, 
  1073.      *   int pTcb
  1074.      */
  1075. #define EVENT_WINDTICKUNDELAY CLASS2_EVENT(18)
  1076.     /* Param:
  1077.      *   short EVENT_WINDTICKUNDELAY, 
  1078.      *   int pTcb
  1079.      */
  1080. #define EVENT_OBJ_TASK CLASS2_EVENT(19)
  1081.     /* Param:
  1082.      *   short EVENT_OBJ_TASK, 
  1083.      *   int pTcb
  1084.      */
  1085. #define EVENT_OBJ_SEMGIVE CLASS2_EVENT(20)
  1086.     /* Param:
  1087.      *   short EVENT_OBJ_SEMGIVE, 
  1088.      *   int semId
  1089.      */
  1090. #define EVENT_OBJ_SEMTAKE CLASS2_EVENT(21)
  1091.     /* Param:
  1092.      *   short EVENT_OBJ_SEMTAKE, 
  1093.      *   int semId
  1094.      */
  1095. #define EVENT_OBJ_SEMFLUSH CLASS2_EVENT(22)
  1096.     /* Param:
  1097.      *   short EVENT_OBJ_SEMFLUSH, 
  1098.      *   int semId
  1099.      */
  1100. #define EVENT_OBJ_MSGSEND CLASS2_EVENT(23)
  1101.     /* Param:
  1102.      *   short EVENT_OBJ_MSGSEND, 
  1103.      *   int msgQId
  1104.      */
  1105. #define EVENT_OBJ_MSGRECEIVE CLASS2_EVENT(24)
  1106.     /* Param:
  1107.      *   short EVENT_OBJ_MSGRECEIVE, 
  1108.      *   int msgQId
  1109.      */
  1110. #define EVENT_OBJ_MSGDELETE CLASS2_EVENT(25)
  1111.     /* Param:
  1112.      *   short EVENT_OBJ_MSGDELETE, 
  1113.      *   int msgQId
  1114.      */
  1115. #define EVENT_OBJ_SIGPAUSE CLASS2_EVENT(26)
  1116.     /* Param:
  1117.      *   short EVENT_OBJ_SIGPAUSE, 
  1118.      *   int qHead
  1119.      */
  1120. #define EVENT_OBJ_SIGSUSPEND CLASS2_EVENT(27)
  1121.     /* Param:
  1122.      *   short EVENT_OBJ_SIGSUSPEND, 
  1123.      *   int sigset
  1124.      */
  1125. #define EVENT_OBJ_SIGKILL CLASS2_EVENT(28)
  1126.     /* Param:
  1127.      *   short EVENT_OBJ_SIGKILL, 
  1128.      *   int tid
  1129.      */
  1130. #define EVENT_WINDTICKTIMEOUT                   CLASS2_EVENT(31)
  1131.     /* Param:
  1132.      *   short EVENT_WINDTICKTIMEOUT,
  1133.      *   int tId
  1134.      */
  1135. #define EVENT_OBJ_SIGWAIT                       CLASS2_EVENT(32)
  1136.     /* Param:
  1137.      *   short EVENT_OBJ_SIGWAIT, 
  1138.      *   int tid
  1139.      */
  1140. #define EVENT_OBJ_EVENTSEND CLASS2_EVENT(35)
  1141.     /* Param:
  1142.      *   short EVENT_OBJ_EVENTSEND 
  1143.      */
  1144. #define EVENT_OBJ_EVENTRECEIVE CLASS2_EVENT(36)
  1145.     /* Param:
  1146.      *   short EVENT_OBJ_EVENTRECEIVE
  1147.      */
  1148. /* CLASS1 events */
  1149. #define EVENT_WIND_EXIT_DISPATCH         CLASS1_EVENT(2)
  1150.     /* Param:
  1151.      *   short EVENT_WIND_EXIT_DISPATCH, 
  1152.      *   int timestamp,
  1153.      *   int tId,
  1154.      *   int priority
  1155.      */
  1156. #define EVENT_WIND_EXIT_NODISPATCH         CLASS1_EVENT(3)
  1157.     /* Param:
  1158.      *   short EVENT_WIND_EXIT_NODISPATCH, 
  1159.      *   int timestamp,
  1160.      *   int priority
  1161.      */
  1162. #define EVENT_WIND_EXIT_DISPATCH_PI         CLASS1_EVENT(4)
  1163.     /* Param:
  1164.      *   short EVENT_WIND_EXIT_DISPATCH_PI, 
  1165.      *   int timestamp,
  1166.      *   int tId,
  1167.      *   int priority
  1168.      */
  1169. #define EVENT_WIND_EXIT_NODISPATCH_PI         CLASS1_EVENT(5)
  1170.     /* Param:
  1171.      *   short EVENT_WIND_EXIT_NODISPATCH_PI, 
  1172.      *   int timestamp,
  1173.      *   int priority
  1174.      */
  1175. #define EVENT_DISPATCH_OFFSET   0xe
  1176. #define EVENT_NODISPATCH_OFFSET   0xa
  1177.     /*
  1178.      * This definition is needed for the logging of the above _PI events
  1179.      */
  1180. #define EVENT_WIND_EXIT_IDLE CLASS1_EVENT(6)
  1181.     /* Param:
  1182.      *   short EVENT_WIND_EXIT_IDLE, 
  1183.      *   int timestamp
  1184.      */
  1185. #define EVENT_TASKLOCK CLASS1_EVENT(7)
  1186.     /* Param:
  1187.      *   short EVENT_TASKLOCK, 
  1188.      *   int timeStamp
  1189.      */
  1190. #define EVENT_TASKUNLOCK CLASS1_EVENT(8)
  1191.     /* Param:
  1192.      *   short EVENT_TASKUNLOCK, 
  1193.      *   int timeStamp
  1194.      */
  1195. #define EVENT_TICKANNOUNCE CLASS1_EVENT(9)
  1196.     /* Param:
  1197.      *   short EVENT_TICKANNOUNCE, 
  1198.      *   int timeStamp
  1199.      */
  1200. #define EVENT_EXCEPTION CLASS1_EVENT(10)
  1201.     /* Param:
  1202.      *   short EVENT_EXCEPTION, 
  1203.      *   int timeStamp, 
  1204.      *   int exception
  1205.      */
  1206. #define EVENT_TASK_STATECHANGE CLASS1_EVENT(11)
  1207.     /* Param:
  1208.      *   short EVENT_STATECHANGE
  1209.      *   int timeStamp,
  1210.      *   int taskId,
  1211.      *   int newState
  1212.      */
  1213. /* pseudo events - generated host side */
  1214. #define MIN_PSEUDO_EVENT                        CLASS1_EVENT(20)
  1215. #define EVENT_STATECHANGE                       CLASS1_EVENT(20)
  1216.     /* Param:
  1217.      *   short EVENT_STATECHANGE
  1218.      *   int newState
  1219.      */
  1220. #define EVENT_NIL                               CLASS1_EVENT(21)
  1221.     /* Param:
  1222.      *   short EVENT_NIL
  1223.      */
  1224. #define EVENT_VALUE                             CLASS1_EVENT(22)
  1225.     /* Param:
  1226.      *   short EVENT_VALUE
  1227.      *   int value
  1228.      */
  1229. #define MAX_PSEUDO_EVENT                        CLASS1_EVENT(24)
  1230. #define IS_PSEUDO_EVENT(event) 
  1231.     ((event >= MIN_PSEUDO_EVENT) && (event <= MAX_PSEUDO_EVENT))
  1232. #ifdef CPU   /* This is for target side build only */
  1233. #ifndef _BYTE_ORDER
  1234. #error _BYTE_ORDER must be defined
  1235. #endif /* _BYTE_ORDER */
  1236. #ifndef _BIG_ENDIAN
  1237. #error _BIG_ENDIAN must be defined
  1238. #endif /* _BIG_ENDIAN */
  1239. /*
  1240.  * Alignment macros used to store unaligned short (16 bits) and unaligned
  1241.  * int (32 bits).
  1242.  */
  1243. #define EVT_STORE_UINT16(pBuf, event_id) 
  1244.     *pBuf++ = (event_id)
  1245. #if (_BYTE_ORDER==_BIG_ENDIAN)
  1246. #   if  CPU_FAMILY==MC680X0 
  1247.      /* unaligned access supported */
  1248. #    define EVT_STORE_UINT32(pBuf, value) 
  1249.      *pBuf++ = (value)
  1250. #   else /* CPU_FAMILY==MC680X0 */
  1251. /* unaligned access not supported */
  1252. # define EVT_STORE_UINT32(pBuf, value) 
  1253.      do { *((short *) pBuf) = (value) >> 16; 
  1254.        *(((short *) pBuf) + 1) = (value); 
  1255.        pBuf++; } while (0)
  1256. #   endif /* CPU_FAMILY==MC680X0 */
  1257. #else /* (_BYTE_ORDER==_BIG_ENDIAN) */
  1258. #   define EVT_STORE_UINT32(pBuf, value) 
  1259.      do { *((short *) pBuf) = (value); 
  1260.        *(((short *) pBuf) + 1) = (value) >> 16; 
  1261.        pBuf++; } while (0)
  1262. #endif /* (_BYTE_ORDER==_BIG_ENDIAN) */
  1263. #endif /* CPU */
  1264. /*
  1265.  * Macro for event logging of intEnt events for PPC architechtures.
  1266.  * The PPC architecture is different in that there is only one external
  1267.  * interrupt line coming into the CPU. At the time of the intEnt, the
  1268.  * external interrupt number is unknown, meaning that logging cannot
  1269.  * take place at this time. In this architechture, the logging of an
  1270.  * intEnt event is deferred until the interrupt controller driver
  1271.  * is exectued.
  1272.  * Since the logging has to take place in drivers and/or BSP world files,
  1273.  * the details of how the logging to be done has been deferred to a macro 
  1274.  * which is defined here.
  1275.  *
  1276.  * Note: This replaces the previous technique of saving the timestamp
  1277.  * during the intEnt code to be used later, when the logging was done.
  1278.  * SPR 21868 refers to a problem in which this can give rise to out-of-order
  1279.  * timestamps in the event log.
  1280.  */
  1281. #if (CPU_FAMILY == PPC) || (CPU_FAMILY == ARM)
  1282. #define WV_EVT_INT_ENT(intNum)     EVT_CTX_0(EVENT_INT_ENT((UINT32)intNum))
  1283. #endif /* CPU_FAMILY == PPC */
  1284. #ifdef __cplusplus
  1285. }
  1286. #endif
  1287. #endif /* __INCeventph*/