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.

nap.h 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef _GPXE_NAP_H
  2. #define _GPXE_NAP_H
  3. /** @file
  4. *
  5. * CPU sleeping
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER );
  9. #include <gpxe/api.h>
  10. #include <config/nap.h>
  11. /**
  12. * Calculate static inline CPU sleeping API function name
  13. *
  14. * @v _prefix Subsystem prefix
  15. * @v _api_func API function
  16. * @ret _subsys_func Subsystem API function
  17. */
  18. #define NAP_INLINE( _subsys, _api_func ) \
  19. SINGLE_API_INLINE ( NAP_PREFIX_ ## _subsys, _api_func )
  20. /**
  21. * Provide an CPU sleeping API implementation
  22. *
  23. * @v _prefix Subsystem prefix
  24. * @v _api_func API function
  25. * @v _func Implementing function
  26. */
  27. #define PROVIDE_NAP( _subsys, _api_func, _func ) \
  28. PROVIDE_SINGLE_API ( NAP_PREFIX_ ## _subsys, _api_func, _func )
  29. /**
  30. * Provide a static inline CPU sleeping API implementation
  31. *
  32. * @v _prefix Subsystem prefix
  33. * @v _api_func API function
  34. */
  35. #define PROVIDE_NAP_INLINE( _subsys, _api_func ) \
  36. PROVIDE_SINGLE_API_INLINE ( NAP_PREFIX_ ## _subsys, _api_func )
  37. /* Include all architecture-independent I/O API headers */
  38. #include <gpxe/null_nap.h>
  39. /* Include all architecture-dependent I/O API headers */
  40. #include <bits/nap.h>
  41. /**
  42. * Sleep until next CPU interrupt
  43. *
  44. */
  45. void cpu_nap ( void );
  46. #endif /* _GPXE_NAP_H */