iPXE
time.h File Reference

Time source. More...

#include <sys/time.h>
#include <ipxe/api.h>
#include <config/time.h>
#include <ipxe/null_time.h>
#include <ipxe/efi/efi_time.h>
#include <ipxe/linux/linux_time.h>
#include <bits/time.h>

Go to the source code of this file.

Macros

#define TIME_INLINE(_subsys, _api_func)
 Calculate static inline time API function name.
#define PROVIDE_TIME(_subsys, _api_func, _func)
 Provide a time API implementation.
#define PROVIDE_TIME_INLINE(_subsys, _api_func)
 Provide a static inline time API implementation.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 FILE_SECBOOT (PERMITTED)
time_t time_now (void)
 Get current time in seconds (ignoring system clock offset)
static __attribute__ ((always_inline)) void time_adjust(signed long delta)
 Adjust system clock.

Variables

signed long time_offset
 Current system clock offset.

Detailed Description

Time source.

Definition in file time.h.

Macro Definition Documentation

◆ TIME_INLINE

#define TIME_INLINE ( _subsys,
_api_func )
Value:
SINGLE_API_INLINE ( TIME_PREFIX_ ## _subsys, _api_func )
#define SINGLE_API_INLINE(_prefix, _api_func)
Calculate static inline function name.
Definition api.h:45

Calculate static inline time API function name.

Parameters
_prefixSubsystem prefix
_api_funcAPI function
Return values
_subsys_funcSubsystem API function

Definition at line 24 of file time.h.

24#define TIME_INLINE( _subsys, _api_func ) \
25 SINGLE_API_INLINE ( TIME_PREFIX_ ## _subsys, _api_func )

◆ PROVIDE_TIME

#define PROVIDE_TIME ( _subsys,
_api_func,
_func )
Value:
PROVIDE_SINGLE_API ( TIME_PREFIX_ ## _subsys, _api_func, _func )
#define PROVIDE_SINGLE_API(_prefix, _api_func, _func)
Provide an API implementation.
Definition api.h:55

Provide a time API implementation.

Parameters
_prefixSubsystem prefix
_api_funcAPI function
_funcImplementing function

Definition at line 34 of file time.h.

34#define PROVIDE_TIME( _subsys, _api_func, _func ) \
35 PROVIDE_SINGLE_API ( TIME_PREFIX_ ## _subsys, _api_func, _func )

◆ PROVIDE_TIME_INLINE

#define PROVIDE_TIME_INLINE ( _subsys,
_api_func )
Value:
PROVIDE_SINGLE_API_INLINE ( TIME_PREFIX_ ## _subsys, _api_func )
#define PROVIDE_SINGLE_API_INLINE(_prefix, _api_func)
Provide a static inline API implementation.
Definition api.h:74

Provide a static inline time API implementation.

Parameters
_prefixSubsystem prefix
_api_funcAPI function

Definition at line 43 of file time.h.

43#define PROVIDE_TIME_INLINE( _subsys, _api_func ) \
44 PROVIDE_SINGLE_API_INLINE ( TIME_PREFIX_ ## _subsys, _api_func )

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )

◆ FILE_SECBOOT()

FILE_SECBOOT ( PERMITTED )

◆ time_now()

time_t time_now ( void )

Get current time in seconds (ignoring system clock offset)

Return values
timeTime, in seconds

Referenced by __attribute__(), PROVIDE_TIME(), PROVIDE_TIME(), and PROVIDE_TIME().

◆ __attribute__()

__attribute__ ( (always_inline) )
inlinestatic

Adjust system clock.

Parameters
deltaClock adjustment, in seconds

Definition at line 68 of file time.h.

69 {
70
71 time_offset += delta;
72}
signed long time_offset
Current system clock offset.
Definition time.c:48

References time_offset.

Variable Documentation

◆ time_offset

signed long time_offset
extern

Current system clock offset.

Definition at line 48 of file time.c.

Referenced by __attribute__(), and __attribute__().