Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / ipxe / src / include / ipxe / time.h
1 #ifndef _IPXE_TIME_H
2 #define _IPXE_TIME_H
3
4 /** @file
5  *
6  * Time source
7  *
8  */
9
10 FILE_LICENCE ( GPL2_OR_LATER );
11
12 #include <sys/time.h>
13 #include <ipxe/api.h>
14 #include <config/time.h>
15
16 /**
17  * Calculate static inline time API function name
18  *
19  * @v _prefix           Subsystem prefix
20  * @v _api_func         API function
21  * @ret _subsys_func    Subsystem API function
22  */
23 #define TIME_INLINE( _subsys, _api_func ) \
24         SINGLE_API_INLINE ( TIME_PREFIX_ ## _subsys, _api_func )
25
26 /**
27  * Provide a time API implementation
28  *
29  * @v _prefix           Subsystem prefix
30  * @v _api_func         API function
31  * @v _func             Implementing function
32  */
33 #define PROVIDE_TIME( _subsys, _api_func, _func ) \
34         PROVIDE_SINGLE_API ( TIME_PREFIX_ ## _subsys, _api_func, _func )
35
36 /**
37  * Provide a static inline time API implementation
38  *
39  * @v _prefix           Subsystem prefix
40  * @v _api_func         API function
41  */
42 #define PROVIDE_TIME_INLINE( _subsys, _api_func ) \
43         PROVIDE_SINGLE_API_INLINE ( TIME_PREFIX_ ## _subsys, _api_func )
44
45 /* Include all architecture-independent time API headers */
46 #include <ipxe/null_time.h>
47 #include <ipxe/linux/linux_time.h>
48
49 /* Include all architecture-dependent time API headers */
50 #include <bits/time.h>
51
52 /**
53  * Get current time in seconds
54  *
55  * @ret time            Time, in seconds
56  */
57 time_t time_now ( void );
58
59 #endif /* _IPXE_TIME_H */