Version
Kernel-space version information declarations.
Cuddl kernel drivers may use this API to retrieve information about the version of the source code used to build the Cuddl kernel modules.
This part of the API is only applicable to kernel-space code.
-
CUDDLK_VARIANT
String identifying the kernel implementation.
(e.g.
"Xenomai UDD","Linux UIO","RTEMS")
-
CUDDLK_VERSION_MAJOR
Major portion of the version number.
-
CUDDLK_VERSION_MINOR
Minor portion of the version number.
-
CUDDLK_REVISION_LEVEL
Revision portion of the version number.
-
CUDDLK_VERSION_CODE
32-bit integer version code value that can be used in comparisons. Similar to
XENO_VERSION_CODEandLINUX_VERSION_CODE.
-
CUDDLK_VERSION
CUDDLK_VERSION (major, minor, revision)
Construct a integer version code.
Parameters
majorMajor portion of the version number.
minorMinor portion of the version number.
revisionRevision portion of the version number.
Description
Returns a 32-bit integer version code corresponding to the given major,
minor, and revision values that can be used in comparisons. Similar to
XENO_VERSION() and KERNEL_VERSION().
Return
Integer version code.
-
CUDDLK_MAJOR_VERSION_FROM_CODE
CUDDLK_MAJOR_VERSION_FROM_CODE (code)
Extract the major version from a code.
Parameters
code32-bit integer version code
Description
Extracts the major version portion of a 32-bit integer version code.
Return
Major portion of the version number.
-
CUDDLK_MINOR_VERSION_FROM_CODE
CUDDLK_MINOR_VERSION_FROM_CODE (code)
Extract the minor version from a code.
Parameters
code32-bit integer version code
Description
Extracts the minor version portion of a 32-bit integer version code.
Return
Minor portion of the version number.
-
CUDDLK_REVISION_LEVEL_FROM_CODE
CUDDLK_REVISION_LEVEL_FROM_CODE (code)
Extract the revision level from a code.
Parameters
code32-bit integer version code
Description
Extracts the revision level portion of a 32-bit integer version code.
Return
Revision level portion of the version number.
-
int cuddlk_get_commit_id(char *id_str, cuddlk_size_t id_len)
Return a string describing the kernel src commit.
Parameters
char *id_strPointer to the buffer to be used for returning the commit id string.
cuddlk_size_t id_lenInput parameter specifying the size of the buffer used for returning the commit id string.
Description
If the Cuddl kernel modules were built from a clean source tree, then the
returned commit id will be a string containing the commit hash (SHA-1
checksum), otherwise it will be a string containing the commit hash with
an M prepended to the front of the string (to indicate that the
sources have been “modified”).
Return
0 on success, or a negative error code.
- Error codes:
None defined (should always succeed).