Xenomai
3.0-rc3
|
This profile includes all mini-drivers sitting on top of the User-space Device Driver framework (UDD). More...
![]() |
Data Structures | |
struct | udd_memregion |
struct | udd_device |
struct | udd_device::udd_reserved |
Reserved to the UDD core. More... | |
struct | udd_signotify |
UDD event notification descriptor. More... | |
Functions | |
int | udd_register_device (struct udd_device *udd) |
Register a UDD device. More... | |
int | udd_unregister_device (struct udd_device *udd) |
Unregister a UDD device. More... | |
struct udd_device * | udd_get_device (struct rtdm_fd *fd) |
RTDM file descriptor to target UDD device. More... | |
void | udd_notify_event (struct udd_device *udd) |
Notify an IRQ event for an unmanaged interrupt. More... | |
void | udd_post_irq_enable (int irq) |
Post a request for enabling an IRQ line. More... | |
void | udd_post_irq_disable (int irq) |
Post a request for disabling an IRQ line. More... | |
#define | UDD_IRQ_NONE 0 |
No IRQ managed. More... | |
#define | UDD_IRQ_CUSTOM (-1) |
IRQ directly managed from the mini-driver on top of the UDD core. More... | |
Memory types for mapping | |
The UDD core implements a default ->mmap() handler which first attempts to hand over the request to the corresponding handler defined by the mini-driver. If not present, the UDD core establishes the mapping automatically, depending on the memory type defined for the region. | |
#define | UDD_MEM_NONE 0 |
No memory region. More... | |
#define | UDD_MEM_PHYS 1 |
Physical I/O memory region. More... | |
#define | UDD_MEM_LOGICAL 2 |
Kernel logical memory region (e.g. More... | |
#define | UDD_MEM_VIRTUAL 3 |
Virtual memory region with no direct physical mapping (e.g. More... | |
UDD_IOCTL | |
#define | UDD_RTIOC_IRQEN _IO(RTDM_CLASS_UDD, 0) |
Enable the interrupt line. More... | |
#define | UDD_RTIOC_IRQDIS _IO(RTDM_CLASS_UDD, 1) |
Disable the interrupt line. More... | |
#define | UDD_RTIOC_IRQSIG _IOW(RTDM_CLASS_UDD, 2, struct udd_signotify) |
Enable/Disable signal notification upon interrupt event. More... | |
This profile includes all mini-drivers sitting on top of the User-space Device Driver framework (UDD).
The generic UDD core driver enables interrupt control and I/O memory access interfaces to user-space device drivers, as defined by the mini-drivers when registering.
A mini-driver supplements the UDD core with ancillary functions for dealing with memory mappings and interrupt control for a particular I/O card/device.
UDD-compliant mini-drivers only have to provide the basic support for dealing with the interrupt sources present in the device, so that most part of the device requests can be handled from a Xenomai application running in user-space.
This profile is reminiscent of the UIO framework available with the Linux kernel, adapted to the dual kernel Cobalt environment.
#define UDD_IRQ_CUSTOM (-1) |
IRQ directly managed from the mini-driver on top of the UDD core.
The mini-driver is in charge of notifying the Cobalt threads waiting for IRQ events by calling the udd_notify_event() service.
Referenced by udd_register_device(), and udd_unregister_device().
#define UDD_IRQ_NONE 0 |
No IRQ managed.
Special IRQ values for udd_device.irq Passing this code implicitly disables all interrupt-related services, including control (disable/enable) and notification.
Referenced by udd_register_device(), and udd_unregister_device().
#define UDD_MEM_LOGICAL 2 |
Kernel logical memory region (e.g.
kmalloc()). By default, the UDD core maps such memory to a virtual user range by calling the rtdm_mmap_kem() service.
#define UDD_MEM_NONE 0 |
No memory region.
Use this type code to disable an entry in the array of memory mappings, i.e. udd_device.mem_regions[].
#define UDD_MEM_PHYS 1 |
Physical I/O memory region.
By default, the UDD core maps such memory to a virtual user range by calling the rtdm_mmap_iomem() service.
#define UDD_MEM_VIRTUAL 3 |
Virtual memory region with no direct physical mapping (e.g.
vmalloc()). By default, the UDD core maps such memory to a virtual user range by calling the rtdm_mmap_vmem() service.
#define UDD_RTIOC_IRQDIS _IO(RTDM_CLASS_UDD, 1) |
Disable the interrupt line.
The UDD-class mini-driver in kernel should act upon this request appropriately when received via its ->ioctl() handler.
#define UDD_RTIOC_IRQEN _IO(RTDM_CLASS_UDD, 0) |
Enable the interrupt line.
The UDD-class mini-driver in kernel space should act upon this request appropriately when received via its ->ioctl() handler.
#define UDD_RTIOC_IRQSIG _IOW(RTDM_CLASS_UDD, 2, struct udd_signotify) |
Enable/Disable signal notification upon interrupt event.
A valid notification descriptor must be passed along with this request, which is handled by the UDD core directly.
struct udd_device* udd_get_device | ( | struct rtdm_fd * | fd | ) |
RTDM file descriptor to target UDD device.
Retrieves the UDD device from a RTDM file descriptor.
fd | File descriptor received by an ancillary I/O handler from a mini-driver based on the UDD core. |
References rtdm_device::driver, rtdm_driver::profile_info, and rtdm_fd_device().
void udd_notify_event | ( | struct udd_device * | udd | ) |
Notify an IRQ event for an unmanaged interrupt.
When the UDD core shall hand over the interrupt management for a device to the mini-driver (see UDD_IRQ_CUSTOM), the latter should notify the UDD core when IRQ events are received by calling this service.
As a result, the UDD core wakes up any Cobalt thread waiting for interrupts on the device via a read(2) or select(2) call.
udd | UDD device descriptor receiving the IRQ. |
References rtdm_event_signal().
void udd_post_irq_disable | ( | int | irq | ) |
Post a request for disabling an IRQ line.
This service issues a request to the regular kernel for disabling the IRQ line mentioned. If the caller runs in primary mode, the request is scheduled but deferred until the current CPU leaves the real-time domain. Otherwise, the request is immediately handled.
irq | IRQ line to disable. |
void udd_post_irq_enable | ( | int | irq | ) |
Post a request for enabling an IRQ line.
This service issues a request to the regular kernel for enabling the IRQ line mentioned. If the caller runs in primary mode, the request is scheduled but deferred until the current CPU leaves the real-time domain. Otherwise, the request is immediately handled.
irq | IRQ line to enable. |
int udd_register_device | ( | struct udd_device * | udd | ) |
Register a UDD device.
This routine registers a mini-driver at the UDD core.
udd | UDD device descriptor which should describe the new device properties. |
References rtdm_driver::context_size, rtdm_driver::device_count, udd_device::device_flags, rtdm_driver::device_flags, rtdm_device::driver, udd_device::interrupt, udd_device::irq, rtdm_device::label, udd_device::mem_regions, rtdm_fd_ops::open, rtdm_driver::ops, rtdm_driver::profile_info, rtdm_dev_register(), rtdm_dev_unregister(), rtdm_event_init(), rtdm_irq_request(), RTDM_NAMED_DEVICE, RTDM_PROTOCOL_DEVICE, UDD_IRQ_CUSTOM, and UDD_IRQ_NONE.
int udd_unregister_device | ( | struct udd_device * | udd | ) |
Unregister a UDD device.
This routine unregisters a mini-driver from the UDD core. This routine waits until all connections to udd have been closed prior to unregistering.
udd | UDD device descriptor |
References udd_device::irq, rtdm_dev_unregister(), rtdm_event_destroy(), rtdm_irq_free(), UDD_IRQ_CUSTOM, and UDD_IRQ_NONE.