You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

timer.h 770B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef GPXE_TIMER_H
  2. #define GPXE_TIMER_H
  3. #include <stddef.h>
  4. #include <gpxe/tables.h>
  5. typedef unsigned long tick_t;
  6. #define MSECS_IN_SEC (1000)
  7. #define USECS_IN_SEC (1000*1000)
  8. #define USECS_IN_MSEC (1000)
  9. #define TICKS_PER_SEC USECS_IN_SEC
  10. extern tick_t currticks ( void );
  11. extern void generic_currticks_udelay ( unsigned int usecs );
  12. /** A timer */
  13. struct timer {
  14. /** Initialise timer
  15. *
  16. * @ret rc Return status code
  17. */
  18. int ( * init ) ( void );
  19. /** Read current time
  20. *
  21. * @ret ticks Current time, in ticks
  22. */
  23. tick_t ( * currticks ) ( void );
  24. /** Delay
  25. *
  26. * @v usecs Time to delay, in microseconds
  27. */
  28. void ( * udelay ) ( unsigned int usecs );
  29. };
  30. #define __timer( order ) __table ( struct timer, timers, order )
  31. #endif /* GPXE_TIMER_H */