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_addr

Page-aligned starting address for the memory region mapping, as returned by mmap(). This value will be a multiple of CUDDLK_PAGE_SIZE. It will be used as the addr argument when calling munmap() to unmap the memory region.

pa_len

Page-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 the length argument when calling munmap() to unmap the memory region.

fd

File descriptor used in the mmap() call to map the memory region. This file descriptor will be closed via close() after calling munmap() when unmapping the memory region.

token

Opaque 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

fd

File 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 via close() when closing the event source.

token

Opaque 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

void

no 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 -errno resulting from from open() call on Cuddl janitor device.

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

int cuddli_close_janitor(int fd)

Clean up resources associated with the current process.

Parameters

int fd

Janitor device file descriptor to close.

Return

0 on success, or a negative error code.

Error codes:
  • Value of -errno resulting from from close() call on the specified file descriptor.