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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef _IPXE_NAP_H
  2. #define _IPXE_NAP_H
  3. /** @file
  4. *
  5. * CPU sleeping
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  9. #include <ipxe/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 <ipxe/null_nap.h>
  39. #include <ipxe/linux/linux_nap.h>
  40. /* Include all architecture-dependent I/O API headers */
  41. #include <bits/nap.h>
  42. /**
  43. * Sleep until next CPU interrupt
  44. *
  45. */
  46. void cpu_nap ( void );
  47. #endif /* _IPXE_NAP_H */