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

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