aboutsummaryrefslogtreecommitdiffstats
path: root/include/litmus/ftdev.h
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2011-07-23 23:38:57 -0400
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2011-11-24 15:21:05 -0500
commit12982f31a233250c7a62b17fb4bd13594cb78777 (patch)
tree31048c4492b13b832d40812599cb08a50c394bce /include/litmus/ftdev.h
parent49e5b0c0d7c09bef5b9bfecaaac3f0ea2cf24e43 (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/litmus/ftdev.h')
-rw-r--r--include/litmus/ftdev.h5
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 */
17typedef int (*ftdev_alloc_t)(struct ftdev* dev, unsigned int buf_no); 17typedef int (*ftdev_alloc_t)(struct ftdev* dev, unsigned int buf_no);
18typedef void (*ftdev_free_t)(struct ftdev* dev, unsigned int buf_no); 18typedef void (*ftdev_free_t)(struct ftdev* dev, unsigned int buf_no);
19 19/* Let devices handle writes from userspace. No synchronization provided. */
20typedef ssize_t (*ftdev_write_t)(struct ft_buffer* buf, size_t len, const char __user *from);
20 21
21struct ftdev_event; 22struct 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
32struct ftdev { 34struct 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
44struct ft_buffer* alloc_ft_buffer(unsigned int count, size_t size); 47struct ft_buffer* alloc_ft_buffer(unsigned int count, size_t size);