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_CODE and LINUX_VERSION_CODE.

CUDDL_VERSION

CUDDL_VERSION (major, minor, revision)

Construct an integer version code.

Parameters

major

Major portion of the version number.

minor

Minor portion of the version number.

revision

Revision 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

code

32-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

code

32-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

code

32-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 -errno resulting from from open() call on Cuddl manager device (Linux).

  • Value of -errno resulting from from ioctl() call on Cuddl manager device (Linux).

  • Value of -errno resulting from from close() 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_str

Pointer to the buffer to be used for returning the commit id string.

cuddl_size_t id_len

Input 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 -errno resulting from from open() call on Cuddl manager device (Linux).

  • Value of -errno resulting from from ioctl() call on Cuddl manager device (Linux).

  • Value of -errno resulting from from close() 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_str

Pointer to the buffer to be used for returning the commit id string.

cuddl_size_t id_len

Input 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 *str

Pointer to the buffer to be used for returning the variant string.

cuddl_size_t len

Input 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 -errno resulting from from open() call on Cuddl manager device (Linux).

  • Value of -errno resulting from from ioctl() call on Cuddl manager device (Linux).

  • Value of -errno resulting from from close() call on Cuddl manager device (Linux).