iPXE
APIs

These are APIs for which only a single implementation may be compiled in at any given time. More...

Macros

#define SINGLE_API_NAME(_prefix, _api_func)
 Calculate function implementation name.
#define SINGLE_API_INLINE(_prefix, _api_func)
 Calculate static inline function name.
#define PROVIDE_SINGLE_API(_prefix, _api_func, _func)
 Provide an API implementation.
#define PROVIDE_SINGLE_API_INLINE(_prefix, _api_func)
 Provide a static inline API implementation.

Detailed Description

These are APIs for which only a single implementation may be compiled in at any given time.

Macro Definition Documentation

◆ SINGLE_API_NAME

#define SINGLE_API_NAME ( _prefix,
_api_func )
Value:
_prefix ## _api_func
char _prefix[]
Start address of the iPXE image.

Calculate function implementation name.

Parameters
_prefixSubsystem prefix
_api_funcAPI function
Return values
_subsys_funcSubsystem API function

The subsystem prefix should be an empty string for the currently selected subsystem, and should be a subsystem-unique string for all other subsystems.

Definition at line 36 of file api.h.

◆ SINGLE_API_INLINE

#define SINGLE_API_INLINE ( _prefix,
_api_func )
Value:
SINGLE_API_NAME ( _prefix, _api_func )
#define SINGLE_API_NAME(_prefix, _api_func)
Calculate function implementation name.
Definition api.h:36

Calculate static inline function name.

Parameters
_prefixSubsystem prefix
_api_funcAPI function
Return values
_subsys_funcSubsystem API function

Definition at line 45 of file api.h.

45#define SINGLE_API_INLINE( _prefix, _api_func ) \
46 SINGLE_API_NAME ( _prefix, _api_func )

◆ PROVIDE_SINGLE_API

#define PROVIDE_SINGLE_API ( _prefix,
_api_func,
_func )
Value:
/* Ensure that _api_func exists */ \
typeof ( _api_func ) _api_func; \
/* Ensure that _func exists */ \
typeof ( _func ) _func; \
/* Ensure that _func is type-compatible with _api_func */ \
typeof ( _api_func ) _func; \
/* Ensure that _subsys_func is non-static */ \
extern typeof ( _api_func ) SINGLE_API_NAME ( _prefix, _api_func ); \
/* Provide symbol alias from _subsys_func to _func */ \
typeof ( _api_func ) SINGLE_API_NAME ( _prefix, _api_func ) \
__attribute__ (( alias ( #_func ) ));
typeof(acpi_finder=acpi_find)
ACPI table finder.
Definition acpi.c:48

Provide an API implementation.

Parameters
_prefixSubsystem prefix
_api_funcAPI function
_funcImplementing function

Definition at line 55 of file api.h.

55#define PROVIDE_SINGLE_API( _prefix, _api_func, _func ) \
56 /* Ensure that _api_func exists */ \
57 typeof ( _api_func ) _api_func; \
58 /* Ensure that _func exists */ \
59 typeof ( _func ) _func; \
60 /* Ensure that _func is type-compatible with _api_func */ \
61 typeof ( _api_func ) _func; \
62 /* Ensure that _subsys_func is non-static */ \
63 extern typeof ( _api_func ) SINGLE_API_NAME ( _prefix, _api_func ); \
64 /* Provide symbol alias from _subsys_func to _func */ \
65 typeof ( _api_func ) SINGLE_API_NAME ( _prefix, _api_func ) \
66 __attribute__ (( alias ( #_func ) ));

◆ PROVIDE_SINGLE_API_INLINE

#define PROVIDE_SINGLE_API_INLINE ( _prefix,
_api_func )
Value:
/* Ensure that _api_func exists */ \
typeof ( _api_func ) _api_func; \
/* Ensure that _subsys_func exists and is static */ \
static typeof ( SINGLE_API_INLINE ( _prefix, _api_func ) ) \
SINGLE_API_INLINE ( _prefix, _api_func ); \
/* Ensure that _subsys_func is type-compatible with _api_func */ \
typeof ( _api_func ) SINGLE_API_INLINE ( _prefix, _api_func );
#define SINGLE_API_INLINE(_prefix, _api_func)
Calculate static inline function name.
Definition api.h:45

Provide a static inline API implementation.

Parameters
_prefixSubsystem prefix
_api_funcAPI function

Definition at line 74 of file api.h.

74#define PROVIDE_SINGLE_API_INLINE( _prefix, _api_func ) \
75 /* Ensure that _api_func exists */ \
76 typeof ( _api_func ) _api_func; \
77 /* Ensure that _subsys_func exists and is static */ \
78 static typeof ( SINGLE_API_INLINE ( _prefix, _api_func ) ) \
79 SINGLE_API_INLINE ( _prefix, _api_func ); \
80 /* Ensure that _subsys_func is type-compatible with _api_func */ \
81 typeof ( _api_func ) SINGLE_API_INLINE ( _prefix, _api_func );