diff options
| author | Christopher Kenna <cjk@cs.unc.edu> | 2011-01-07 20:46:25 -0500 |
|---|---|---|
| committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-01-12 19:29:35 -0500 |
| commit | 37eb46be881dde4b405d3d8b48e76b4a8d62ae2c (patch) | |
| tree | aab617d44f19114ecc9ea7cf7e1d64ee35430005 /include/litmus/ftdev.h | |
| parent | 7648363e5636bd865aeac3236eb4675f0687eb4a (diff) | |
Feather-Trace: register devices with sysfs
This patch implements support for Feather-Trace devices to use the sysfs
file system and, consequently, udev support.
This allows us to allocate major/minor numbers for Feather-Trace
devices dynamically, which is desirable because our old static
allocations tend to create conflicts on modern distributions and/or
when there are many cores.
Diffstat (limited to 'include/litmus/ftdev.h')
| -rw-r--r-- | include/litmus/ftdev.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/litmus/ftdev.h b/include/litmus/ftdev.h index 7697b4616699..efb2a5c9a9b0 100644 --- a/include/litmus/ftdev.h +++ b/include/litmus/ftdev.h | |||
| @@ -28,10 +28,13 @@ struct ftdev_minor { | |||
| 28 | struct mutex lock; | 28 | struct mutex lock; |
| 29 | /* FIXME: filter for authorized events */ | 29 | /* FIXME: filter for authorized events */ |
| 30 | struct ftdev_event* events; | 30 | struct ftdev_event* events; |
| 31 | struct device* device; | ||
| 31 | }; | 32 | }; |
| 32 | 33 | ||
| 33 | struct ftdev { | 34 | struct ftdev { |
| 34 | struct cdev cdev; | 35 | struct cdev cdev; |
| 36 | struct class* class; | ||
| 37 | const char* name; | ||
| 35 | /* FIXME: don't waste memory, allocate dynamically */ | 38 | /* FIXME: don't waste memory, allocate dynamically */ |
| 36 | struct ftdev_minor minor[MAX_FTDEV_MINORS]; | 39 | struct ftdev_minor minor[MAX_FTDEV_MINORS]; |
| 37 | unsigned int minor_cnt; | 40 | unsigned int minor_cnt; |
| @@ -43,7 +46,7 @@ struct ftdev { | |||
| 43 | struct ft_buffer* alloc_ft_buffer(unsigned int count, size_t size); | 46 | struct ft_buffer* alloc_ft_buffer(unsigned int count, size_t size); |
| 44 | void free_ft_buffer(struct ft_buffer* buf); | 47 | void free_ft_buffer(struct ft_buffer* buf); |
| 45 | 48 | ||
| 46 | void ftdev_init(struct ftdev* ftdev, struct module* owner); | 49 | void ftdev_init(struct ftdev* ftdev, struct module* owner, const char* name); |
| 47 | int register_ftdev(struct ftdev* ftdev, const char* name, int major); | 50 | int register_ftdev(struct ftdev* ftdev); |
| 48 | 51 | ||
| 49 | #endif | 52 | #endif |
