Xenomai  3.0.5
udd.h
Go to the documentation of this file.
1 
19 #ifndef _COBALT_RTDM_UDD_H
20 #define _COBALT_RTDM_UDD_H
21 
22 #include <linux/list.h>
23 #include <rtdm/driver.h>
24 #include <rtdm/uapi/udd.h>
25 
65 #define UDD_IRQ_NONE 0
66 
72 #define UDD_IRQ_CUSTOM (-1)
73 
91 #define UDD_MEM_NONE 0
92 
97 #define UDD_MEM_PHYS 1
98 
102 #define UDD_MEM_LOGICAL 2
103 
108 #define UDD_MEM_VIRTUAL 3
109 
111 #define UDD_NR_MAPS 5
112 
167  const char *name;
173  unsigned long addr;
178  size_t len;
183  int type;
184 };
185 
193 struct udd_device {
198  const char *device_name;
211  struct {
219  int (*open)(struct rtdm_fd *fd, int oflags);
227  void (*close)(struct rtdm_fd *fd);
240  int (*ioctl)(struct rtdm_fd *fd,
241  unsigned int request, void *arg);
256  int (*mmap)(struct rtdm_fd *fd,
257  struct vm_area_struct *vma);
286  int (*interrupt)(struct udd_device *udd);
287  } ops;
294  int irq;
301  struct udd_memregion mem_regions[UDD_NR_MAPS];
303  struct udd_reserved {
304  rtdm_irq_t irqh;
305  atomic_t event;
306  struct udd_signotify signfy;
307  struct rtdm_event pulse;
308  struct rtdm_driver driver;
309  struct rtdm_device device;
310  struct rtdm_driver mapper_driver;
311  struct udd_mapper {
312  struct udd_device *udd;
313  struct rtdm_device dev;
314  } mapdev[UDD_NR_MAPS];
315  char *mapper_name;
316  int nr_maps;
317  } __reserved;
318 };
319 
320 int udd_register_device(struct udd_device *udd);
321 
322 int udd_unregister_device(struct udd_device *udd);
323 
324 struct udd_device *udd_get_device(struct rtdm_fd *fd);
325 
326 void udd_notify_event(struct udd_device *udd);
327 
328 void udd_enable_irq(struct udd_device *udd,
329  rtdm_event_t *done);
330 
331 void udd_disable_irq(struct udd_device *udd,
332  rtdm_event_t *done);
333 
336 #endif /* !_COBALT_RTDM_UDD_H */
int udd_register_device(struct udd_device *udd)
Register a UDD device.
Definition: udd.c:349
const char * name
Name of the region (informational but required)
Definition: udd.h:167
const char * device_name
Name of the device managed by the mini-driver, appears automatically in the /dev/rtdm namespace upon ...
Definition: udd.h:198
unsigned long addr
Start address of the region.
Definition: udd.h:173
Reserved to the UDD core.
Definition: udd.h:303
This file is part of the Xenomai project.
Definition: udd.h:165
struct udd_device * udd_get_device(struct rtdm_fd *fd)
RTDM file descriptor to target UDD device.
Definition: udd.c:645
void udd_disable_irq(struct udd_device *udd, rtdm_event_t *done)
Disable the device IRQ line.
Definition: udd.c:620
size_t len
Length (in bytes) of the region.
Definition: udd.h:178
Real-Time Driver Model for Xenomai, driver API header.
void udd_notify_event(struct udd_device *udd)
Notify an IRQ event for an unmanaged interrupt.
Definition: udd.c:500
Definition: udd.h:193
void udd_enable_irq(struct udd_device *udd, rtdm_event_t *done)
Enable the device IRQ line.
Definition: udd.c:586
int irq
IRQ number.
Definition: udd.h:294
int device_subclass
Subclass code of the device managed by the mini-driver (see RTDM_SUBCLASS_xxx definition in the Devic...
Definition: udd.h:210
int device_flags
Additional device flags (e.g.
Definition: udd.h:203
Copyright © 2011 Gilles Chanteperdrix gilles.chanteperdrix@xenomai.org.
Definition: atomic.h:24
int udd_unregister_device(struct udd_device *udd)
Unregister a UDD device.
Definition: udd.c:450
int type
Type of the region.
Definition: udd.h:183
UDD event notification descriptor.
Definition: udd.h:44
RTDM device.
Definition: driver.h:338
RTDM driver.
Definition: driver.h:249