iPXE
nap.h
Go to the documentation of this file.
00001 #ifndef _IPXE_NAP_H
00002 #define _IPXE_NAP_H
00003 
00004 /** @file
00005  *
00006  * CPU sleeping
00007  *
00008  */
00009 
00010 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00011 
00012 #include <ipxe/api.h>
00013 #include <config/nap.h>
00014 
00015 /**
00016  * Calculate static inline CPU sleeping API function name
00017  *
00018  * @v _prefix           Subsystem prefix
00019  * @v _api_func         API function
00020  * @ret _subsys_func    Subsystem API function
00021  */
00022 #define NAP_INLINE( _subsys, _api_func ) \
00023         SINGLE_API_INLINE ( NAP_PREFIX_ ## _subsys, _api_func )
00024 
00025 /**
00026  * Provide an CPU sleeping API implementation
00027  *
00028  * @v _prefix           Subsystem prefix
00029  * @v _api_func         API function
00030  * @v _func             Implementing function
00031  */
00032 #define PROVIDE_NAP( _subsys, _api_func, _func ) \
00033         PROVIDE_SINGLE_API ( NAP_PREFIX_ ## _subsys, _api_func, _func )
00034 
00035 /**
00036  * Provide a static inline CPU sleeping API implementation
00037  *
00038  * @v _prefix           Subsystem prefix
00039  * @v _api_func         API function
00040  */
00041 #define PROVIDE_NAP_INLINE( _subsys, _api_func ) \
00042         PROVIDE_SINGLE_API_INLINE ( NAP_PREFIX_ ## _subsys, _api_func )
00043 
00044 /* Include all architecture-independent I/O API headers */
00045 #include <ipxe/null_nap.h>
00046 #include <ipxe/linux/linux_nap.h>
00047 
00048 /* Include all architecture-dependent I/O API headers */
00049 #include <bits/nap.h>
00050 
00051 /**
00052  * Sleep until next CPU interrupt
00053  *
00054  */
00055 void cpu_nap ( void );
00056 
00057 #endif /* _IPXE_NAP_H */