Linux/Xenomai User Space
User-space declarations for the Linux implementation.
These declarations apply to both Linux UIO and Xenomai UDD. They are only available to user-space code.
-
struct cuddli_memregion_priv
Private memory region data.
Definition
struct cuddli_memregion_priv {
unsigned long pa_addr;
size_t pa_len;
int fd;
struct cuddlci_token token;
};
Members
pa_addrPage-aligned starting address for the memory region mapping, as returned by
mmap(). This value will be a multiple ofCUDDLK_PAGE_SIZE. It will be used as theaddrargument when callingmunmap()to unmap the memory region.pa_lenPage-aligned length of the memory region. This field represents the size of the memory region to be mapped, in bytes, and will be a multiple of
CUDDLK_PAGE_SIZE. This value will be used as thelengthargument when callingmunmap()to unmap the memory region.fdFile descriptor used in the
mmap()call to map the memory region. This file descriptor will be closed viaclose()after callingmunmap()when unmapping the memory region.tokenOpaque token used (internally) when releasing ownership of the associated memory region.
Description
This data structure contains private, platform-specific data members reserved for internal use by the Cuddl implementation.
-
struct cuddli_eventsrc_priv
Private event source data.
Definition
struct cuddli_eventsrc_priv {
int fd;
struct cuddlci_token token;
};
Members
fdFile descriptor used in the
open()call when opening the event source. This file descriptor will be used to wait on events and to enable/disable interrupt events. The file descriptor will be closed viaclose()when closing the event source.tokenOpaque token used (internally) when releasing ownership of the associated event source.
Description
This data structure contains private, platform-specific data members reserved for internal use by the Cuddl implementation.
-
int cuddli_open_janitor(void)
Register a process to cleanup on application crash.
Parameters
voidno arguments
Description
When the process ends, all resources associated with the process will be freed.
Return
Positive file desciptor on success, or a negative error code.
- Error codes:
Value of
-errnoresulting from fromopen()call on Cuddl janitor device.Value of
-errnoresulting from fromioctl()call on Cuddl janitor device.
-
int cuddli_close_janitor(int fd)
Clean up resources associated with the current process.
Parameters
int fdJanitor device file descriptor to close.
Return
0 on success, or a negative error code.
- Error codes:
Value of
-errnoresulting from fromclose()call on the specified file descriptor.