Version
User-space version information declarations.
User-space applications may use this API to retrieve information about the version of the source code used to build the Cuddl kernel modules and user-space interface code.
This part of the API is only applicable to user-space code.
-
CUDDL_VERSION_MAJOR
Major portion of the version number.
-
CUDDL_VERSION_MINOR
Minor portion of the version number.
-
CUDDL_REVISION_LEVEL
Revision portion of the version number.
-
CUDDL_VERSION_CODE
32-bit integer version code value that can be used in comparisons. Similar to
XENO_VERSION_CODEandLINUX_VERSION_CODE.
-
CUDDL_VERSION
CUDDL_VERSION (major, minor, revision)
Construct an 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.
-
CUDDL_MAJOR_VERSION_FROM_CODE
CUDDL_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.
-
CUDDL_MINOR_VERSION_FROM_CODE
CUDDL_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.
-
CUDDL_REVISION_LEVEL_FROM_CODE
CUDDL_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 cuddl_get_kernel_version_code()
Return the kernel version code.
Parameters
Description
Retrieve the CUDDLK_VERSION_CODE from the kernel.
Return
The kernel version code on success, or a negative error code.
- Error codes:
-ENOMEM: Error allocating memory in IOCTL call (Linux).
-EOVERFLOW: Error copying data to/from kernel space (Linux).
-ENOEXEC: User/kernel major version number mismatch (Linux).Value of
-errnoresulting from fromopen()call on Cuddl manager device (Linux).Value of
-errnoresulting from fromioctl()call on Cuddl manager device (Linux).Value of
-errnoresulting from fromclose()call on Cuddl manager device (Linux).
-
int cuddl_get_kernel_commit_id(char *id_str, cuddl_size_t id_len)
Return the kernel commit id string.
Parameters
char *id_strPointer to the buffer to be used for returning the commit id string.
cuddl_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:
-ENOMEM: Error allocating memory in IOCTL call (Linux).
-EOVERFLOW: Error copying data to/from kernel space (Linux).
-ENOEXEC: User/kernel major version number mismatch (Linux).Value of
-errnoresulting from fromopen()call on Cuddl manager device (Linux).Value of
-errnoresulting from fromioctl()call on Cuddl manager device (Linux).Value of
-errnoresulting from fromclose()call on Cuddl manager device (Linux).
-
int cuddl_get_userspace_commit_id(char *id_str, cuddl_size_t id_len)
Return the user-space commit id string.
Parameters
char *id_strPointer to the buffer to be used for returning the commit id string.
cuddl_size_t id_lenInput parameter specifying the size of the buffer used for returning the commit id string.
Description
If the Cuddl user-space interface code was 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).
-
int cuddl_get_kernel_variant(char *str, cuddl_size_t len)
Retrieve the kernel variant description.
Parameters
char *strPointer to the buffer to be used for returning the variant string.
cuddl_size_t lenInput parameter specifying the size of the buffer used for returning the variant string.
Description
Retrieve the CUDDLK_VARIANT string from the kernel. This string
identifies the kernel implementation (e.g. "Xenomai UDD", "Linux
UIO", "RTEMS").
Return
0 on success, or a negative error code.
- Error codes:
-ENOMEM: Error allocating memory in IOCTL call (Linux).
-EOVERFLOW: Error copying data to/from kernel space (Linux).
-ENOEXEC: User/kernel major version number mismatch (Linux).Value of
-errnoresulting from fromopen()call on Cuddl manager device (Linux).Value of
-errnoresulting from fromioctl()call on Cuddl manager device (Linux).Value of
-errnoresulting from fromclose()call on Cuddl manager device (Linux).