Xenomai
3.1
|
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_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_enable_irq (struct udd_device *udd, rtdm_event_t *done) |
Enable the device IRQ line More... | |
void | udd_disable_irq (struct udd_device *udd, rtdm_event_t *done) |
Disable the device 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. Typically, a mini-driver would handle the interrupt top-half, and the user-space application would handle the bottom-half.
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 attaching the handler(s) to the IRQ(s) it manages, notifying the Cobalt threads waiting for IRQ events by calling the udd_notify_event() service.
Referenced by udd_register_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().
#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_kmem() 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 should handle this request when received through its ->ioctl() handler if provided. Otherwise, the UDD core disables the interrupt line in the interrupt controller before returning to the caller.
#define UDD_RTIOC_IRQEN _IO(RTDM_CLASS_UDD, 0) |
Enable the interrupt line.
The UDD-class mini-driver should handle this request when received through its ->ioctl() handler if provided. Otherwise, the UDD core enables the interrupt line in the interrupt controller before returning to the caller.
#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.
void udd_disable_irq | ( | struct udd_device * | udd, |
rtdm_event_t * | done | ||
) |
Disable the device IRQ line
This service issues a request to the regular kernel for disabling the IRQ line registered by the driver. If the caller runs in primary mode, the request is scheduled but deferred until the current CPU leaves the real-time domain (see note). Otherwise, the request is immediately handled.
udd | The UDD driver handling the IRQ to disable. If no IRQ was registered by the driver at the UDD core, this routine has no effect. |
done | Optional event to signal upon completion. If non-NULL, done will be posted by a call to rtdm_event_signal() after the interrupt line is disabled. |
void udd_enable_irq | ( | struct udd_device * | udd, |
rtdm_event_t * | done | ||
) |
Enable the device IRQ line
This service issues a request to the regular kernel for enabling the IRQ line registered by the driver. If the caller runs in primary mode, the request is scheduled but deferred until the current CPU leaves the real-time domain (see note). Otherwise, the request is immediately handled.
udd | The UDD driver handling the IRQ to disable. If no IRQ was registered by the driver at the UDD core, this routine has no effect. |
done | Optional event to signal upon completion. If non-NULL, done will be posted by a call to rtdm_event_signal() after the interrupt line is enabled. |
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. |
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. |
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 udd_device::device_flags, udd_device::interrupt, udd_device::irq, 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 |