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