diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-07-23 23:38:57 -0400 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-11-24 15:21:05 -0500 |
commit | 12982f31a233250c7a62b17fb4bd13594cb78777 (patch) | |
tree | 31048c4492b13b832d40812599cb08a50c394bce /include | |
parent | 49e5b0c0d7c09bef5b9bfecaaac3f0ea2cf24e43 (diff) |
ftdev: let bufffer-specific code handle writes from userspace
This allows us to splice in information into logs from events
that were recorded in userspace.
Diffstat (limited to 'include')
-rw-r--r-- | include/litmus/ftdev.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/litmus/ftdev.h b/include/litmus/ftdev.h index 348387e9adf9..0b959874dd70 100644 --- a/include/litmus/ftdev.h +++ b/include/litmus/ftdev.h | |||
@@ -16,7 +16,8 @@ typedef int (*ftdev_can_open_t)(struct ftdev* dev, unsigned int buf_no); | |||
16 | /* return 0 on success, otherwise -$REASON */ | 16 | /* return 0 on success, otherwise -$REASON */ |
17 | typedef int (*ftdev_alloc_t)(struct ftdev* dev, unsigned int buf_no); | 17 | typedef int (*ftdev_alloc_t)(struct ftdev* dev, unsigned int buf_no); |
18 | typedef void (*ftdev_free_t)(struct ftdev* dev, unsigned int buf_no); | 18 | typedef void (*ftdev_free_t)(struct ftdev* dev, unsigned int buf_no); |
19 | 19 | /* Let devices handle writes from userspace. No synchronization provided. */ | |
20 | typedef ssize_t (*ftdev_write_t)(struct ft_buffer* buf, size_t len, const char __user *from); | ||
20 | 21 | ||
21 | struct ftdev_event; | 22 | struct ftdev_event; |
22 | 23 | ||
@@ -27,6 +28,7 @@ struct ftdev_minor { | |||
27 | /* FIXME: filter for authorized events */ | 28 | /* FIXME: filter for authorized events */ |
28 | struct ftdev_event* events; | 29 | struct ftdev_event* events; |
29 | struct device* device; | 30 | struct device* device; |
31 | struct ftdev* ftdev; | ||
30 | }; | 32 | }; |
31 | 33 | ||
32 | struct ftdev { | 34 | struct ftdev { |
@@ -39,6 +41,7 @@ struct ftdev { | |||
39 | ftdev_alloc_t alloc; | 41 | ftdev_alloc_t alloc; |
40 | ftdev_free_t free; | 42 | ftdev_free_t free; |
41 | ftdev_can_open_t can_open; | 43 | ftdev_can_open_t can_open; |
44 | ftdev_write_t write; | ||
42 | }; | 45 | }; |
43 | 46 | ||
44 | struct ft_buffer* alloc_ft_buffer(unsigned int count, size_t size); | 47 | struct ft_buffer* alloc_ft_buffer(unsigned int count, size_t size); |