home *** CD-ROM | disk | FTP | other *** search
/ ftp.whtech.com / ftp.whtech.com.7z / ftp.whtech.com / emulators / v9t9 / linux / sources / V9t9 / source / timer.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-10-19  |  756 b   |  39 lines

  1. #ifndef __TIMER_H__
  2. #define __TIMER_H__
  3.  
  4. #include "centry.h"
  5.  
  6. extern    int    TM_Installed;            /* 1 if timer going */
  7.  
  8. int        TM_Init(void);
  9. void    TM_Kill(void);
  10. int        TM_Start(void);
  11. void    TM_TickHandler(int unused);
  12. int        TM_Stop(void);
  13. int        TM_GetTicks(void);
  14.  
  15. int        TM_UniqueTag(void);
  16.  
  17. //    ticks = hz * TM_HZ
  18. int        TM_SetEvent(int tag,int ticks,int start,int flags,volatile void *flag);
  19. int        TM_ResetEvent(int tag);
  20.  
  21. /*    flags for TM_SetEvent:    */
  22.  
  23. #define    TM_REPEAT    1        /* repeat event */
  24. #define    TM_FUNC        2        /* 'void *flag' is actually void (*flag)() */
  25.  
  26. typedef void (*tm_timer_func)(void);
  27. #define TM_EVENT_FUNC(x)    (volatile void *)(x)
  28.  
  29. #if defined(UNDER_WIN32)
  30. #define TM_HZ    100
  31. #else
  32. #define TM_HZ     100            /* base clock freq */
  33. #endif
  34.  
  35.  
  36. #include "cexit.h"
  37.  
  38. #endif
  39.