distLibP.h
上传用户:nvosite88
上传日期:2007-01-17
资源大小:4983k
文件大小:1k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* distLibP.h - distributed object support routines private header (VxFusion) */
  2. /* Copyright 1999 - 2001 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01d,10oct01,jws  change MSEC macro definitions to eliminate float ops (SPR70851)
  7. 01c,19feb99,drm  Adding rounding to DIST_TICKS_... and DIST_MSEC_...
  8. 01b,11sep98,drm  added distDump() to list of functions
  9. 01a,04sep97,ur   written.
  10. */
  11. #ifndef __INCdistLibPh
  12. #define __INCdistLibPh
  13. #include "vxWorks.h"
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /*
  18.  * Convert from one tick rate to another.  Quietly fails if the
  19.  * output is greater than 2**32 - 1.
  20.  * Note - the literal 2LL promotes the calculation to long long,
  21.  *        so keep it leftmost.
  22.  */
  23. #define TICKS_TO_TICKS(t, rateIn, rateOut) 
  24.     (  
  25.     ((t) == WAIT_FOREVER)  ?  
  26.         (t) :  
  27.         (UINT32)(((2LL * ((UINT32)(t)) * (rateOut)) / (rateIn) + 1LL) / 2LL)  
  28.     )
  29. #define DIST_TICKS_TO_MSEC(ticks)  TICKS_TO_TICKS(ticks, sysClkRateGet(), 1000)
  30. #define DIST_MSEC_TO_TICKS(msec)  TICKS_TO_TICKS(msec, 1000, sysClkRateGet())
  31. #if defined(__STDC__) || defined(__cplusplus)
  32. void distPanic (char *fmt, ...);
  33. void distLog (char *fmt, ...);
  34. void    distDump (char *buffer, int len);
  35. #else   /* __STDC__ */
  36. void distPanic ();
  37. void distLog ();
  38. void    distDump ();
  39. #endif  /* __STDC__ */
  40. #ifdef __cplusplus
  41. }
  42. #endif
  43. #endif /* __INCdistLibPh */