Revert "Roll NDK to r11c and extract it into its own repository."
[android_tools.git] / ndk / platforms / android-16 / arch-x86 / usr / include / linux / relay.h
blob09f72198a077d29d6cc01cd9a9fb7b7dd90c8e61
1 /****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 ****************************************************************************
11 ****************************************************************************/
12 #ifndef _LINUX_RELAY_H
13 #define _LINUX_RELAY_H
15 #include <linux/types.h>
16 #include <linux/sched.h>
17 #include <linux/wait.h>
18 #include <linux/list.h>
19 #include <linux/fs.h>
20 #include <linux/poll.h>
21 #include <linux/kref.h>
23 #define FIX_SIZE(x) ((((x) - 1) & PAGE_MASK) + PAGE_SIZE)
25 #define RELAYFS_CHANNEL_VERSION 6
27 struct rchan_buf
29 void *start;
30 void *data;
31 size_t offset;
32 size_t subbufs_produced;
33 size_t subbufs_consumed;
34 struct rchan *chan;
35 wait_queue_head_t read_wait;
36 struct work_struct wake_readers;
37 struct dentry *dentry;
38 struct kref kref;
39 struct page **page_array;
40 unsigned int page_count;
41 unsigned int finalized;
42 size_t *padding;
43 size_t prev_padding;
44 size_t bytes_consumed;
45 unsigned int cpu;
46 } ____cacheline_aligned;
48 struct rchan
50 u32 version;
51 size_t subbuf_size;
52 size_t n_subbufs;
53 size_t alloc_size;
54 struct rchan_callbacks *cb;
55 struct kref kref;
56 void *private_data;
57 size_t last_toobig;
58 struct rchan_buf *buf[NR_CPUS];
61 struct rchan_callbacks
64 int (*subbuf_start) (struct rchan_buf *buf,
65 void *subbuf,
66 void *prev_subbuf,
67 size_t prev_padding);
69 void (*buf_mapped)(struct rchan_buf *buf,
70 struct file *filp);
72 void (*buf_unmapped)(struct rchan_buf *buf,
73 struct file *filp);
75 struct dentry *(*create_buf_file)(const char *filename,
76 struct dentry *parent,
77 int mode,
78 struct rchan_buf *buf,
79 int *is_global);
81 int (*remove_buf_file)(struct dentry *dentry);
84 struct rchan *relay_open(const char *base_filename,
85 struct dentry *parent,
86 size_t subbuf_size,
87 size_t n_subbufs,
88 struct rchan_callbacks *cb);
90 #endif