.. | .. |
---|
37 | 37 | struct ctl_table_header; |
---|
38 | 38 | struct ctl_dir; |
---|
39 | 39 | |
---|
40 | | -typedef int proc_handler (struct ctl_table *ctl, int write, |
---|
41 | | - void __user *buffer, size_t *lenp, loff_t *ppos); |
---|
| 40 | +/* Keep the same order as in fs/proc/proc_sysctl.c */ |
---|
| 41 | +#define SYSCTL_NEG_ONE ((void *)&android_gki_sysctl_vals[0]) |
---|
| 42 | +#define SYSCTL_ZERO ((void *)&android_gki_sysctl_vals[1]) |
---|
| 43 | +#define SYSCTL_ONE ((void *)&android_gki_sysctl_vals[2]) |
---|
| 44 | +#define SYSCTL_TWO ((void *)&android_gki_sysctl_vals[3]) |
---|
| 45 | +#define SYSCTL_FOUR ((void *)&android_gki_sysctl_vals[4]) |
---|
| 46 | +#define SYSCTL_ONE_HUNDRED ((void *)&android_gki_sysctl_vals[5]) |
---|
| 47 | +#define SYSCTL_TWO_HUNDRED ((void *)&android_gki_sysctl_vals[6]) |
---|
| 48 | +#define SYSCTL_ONE_THOUSAND ((void *)&android_gki_sysctl_vals[7]) |
---|
| 49 | +#define SYSCTL_THREE_THOUSAND ((void *)&android_gki_sysctl_vals[8]) |
---|
| 50 | +#define SYSCTL_INT_MAX ((void *)&android_gki_sysctl_vals[9]) |
---|
42 | 51 | |
---|
43 | | -extern int proc_dostring(struct ctl_table *, int, |
---|
44 | | - void __user *, size_t *, loff_t *); |
---|
45 | | -extern int proc_dointvec(struct ctl_table *, int, |
---|
46 | | - void __user *, size_t *, loff_t *); |
---|
47 | | -extern int proc_douintvec(struct ctl_table *, int, |
---|
48 | | - void __user *, size_t *, loff_t *); |
---|
49 | | -extern int proc_dointvec_minmax(struct ctl_table *, int, |
---|
50 | | - void __user *, size_t *, loff_t *); |
---|
51 | | -extern int proc_douintvec_minmax(struct ctl_table *table, int write, |
---|
52 | | - void __user *buffer, size_t *lenp, |
---|
53 | | - loff_t *ppos); |
---|
54 | | -extern int proc_dointvec_jiffies(struct ctl_table *, int, |
---|
55 | | - void __user *, size_t *, loff_t *); |
---|
56 | | -extern int proc_dointvec_userhz_jiffies(struct ctl_table *, int, |
---|
57 | | - void __user *, size_t *, loff_t *); |
---|
58 | | -extern int proc_dointvec_ms_jiffies(struct ctl_table *, int, |
---|
59 | | - void __user *, size_t *, loff_t *); |
---|
60 | | -extern int proc_doulongvec_minmax(struct ctl_table *, int, |
---|
61 | | - void __user *, size_t *, loff_t *); |
---|
62 | | -extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, |
---|
63 | | - void __user *, size_t *, loff_t *); |
---|
64 | | -extern int proc_do_large_bitmap(struct ctl_table *, int, |
---|
65 | | - void __user *, size_t *, loff_t *); |
---|
| 52 | +extern const int sysctl_vals[]; |
---|
| 53 | +extern const int android_gki_sysctl_vals[]; |
---|
| 54 | + |
---|
| 55 | +typedef int proc_handler(struct ctl_table *ctl, int write, void *buffer, |
---|
| 56 | + size_t *lenp, loff_t *ppos); |
---|
| 57 | + |
---|
| 58 | +int proc_dostring(struct ctl_table *, int, void *, size_t *, loff_t *); |
---|
| 59 | +int proc_dointvec(struct ctl_table *, int, void *, size_t *, loff_t *); |
---|
| 60 | +int proc_douintvec(struct ctl_table *, int, void *, size_t *, loff_t *); |
---|
| 61 | +int proc_dointvec_minmax(struct ctl_table *, int, void *, size_t *, loff_t *); |
---|
| 62 | +int proc_douintvec_minmax(struct ctl_table *table, int write, void *buffer, |
---|
| 63 | + size_t *lenp, loff_t *ppos); |
---|
| 64 | +int proc_dou8vec_minmax(struct ctl_table *table, int write, void *buffer, |
---|
| 65 | + size_t *lenp, loff_t *ppos); |
---|
| 66 | +int proc_dointvec_jiffies(struct ctl_table *, int, void *, size_t *, loff_t *); |
---|
| 67 | +int proc_dointvec_userhz_jiffies(struct ctl_table *, int, void *, size_t *, |
---|
| 68 | + loff_t *); |
---|
| 69 | +int proc_dointvec_ms_jiffies(struct ctl_table *, int, void *, size_t *, |
---|
| 70 | + loff_t *); |
---|
| 71 | +int proc_doulongvec_minmax(struct ctl_table *, int, void *, size_t *, loff_t *); |
---|
| 72 | +int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, void *, |
---|
| 73 | + size_t *, loff_t *); |
---|
| 74 | +int proc_do_large_bitmap(struct ctl_table *, int, void *, size_t *, loff_t *); |
---|
| 75 | +int proc_do_static_key(struct ctl_table *table, int write, void *buffer, |
---|
| 76 | + size_t *lenp, loff_t *ppos); |
---|
66 | 77 | |
---|
67 | 78 | /* |
---|
68 | 79 | * Register a set of sysctl names by calling register_sysctl_table |
---|
.. | .. |
---|
73 | 84 | * sysctl names can be mirrored automatically under /proc/sys. The |
---|
74 | 85 | * procname supplied controls /proc naming. |
---|
75 | 86 | * |
---|
76 | | - * The table's mode will be honoured both for sys_sysctl(2) and |
---|
77 | | - * proc-fs access. |
---|
| 87 | + * The table's mode will be honoured for proc-fs access. |
---|
78 | 88 | * |
---|
79 | 89 | * Leaf nodes in the sysctl tree will be represented by a single file |
---|
80 | 90 | * under /proc; non-leaf nodes will be represented by directories. A |
---|
81 | 91 | * null procname disables /proc mirroring at this node. |
---|
82 | 92 | * |
---|
83 | | - * sysctl(2) can automatically manage read and write requests through |
---|
84 | | - * the sysctl table. The data and maxlen fields of the ctl_table |
---|
| 93 | + * The data and maxlen fields of the ctl_table |
---|
85 | 94 | * struct enable minimal validation of the values being written to be |
---|
86 | 95 | * performed, and the mode field allows minimal authentication. |
---|
87 | 96 | * |
---|
.. | .. |
---|
110 | 119 | struct ctl_table_poll name = __CTL_TABLE_POLL_INITIALIZER(name) |
---|
111 | 120 | |
---|
112 | 121 | /* A sysctl table is an array of struct ctl_table: */ |
---|
113 | | -struct ctl_table |
---|
114 | | -{ |
---|
| 122 | +struct ctl_table { |
---|
115 | 123 | const char *procname; /* Text ID for /proc/sys, or zero */ |
---|
116 | 124 | void *data; |
---|
117 | 125 | int maxlen; |
---|
.. | .. |
---|
130 | 138 | |
---|
131 | 139 | /* struct ctl_table_header is used to maintain dynamic lists of |
---|
132 | 140 | struct ctl_table trees. */ |
---|
133 | | -struct ctl_table_header |
---|
134 | | -{ |
---|
| 141 | +struct ctl_table_header { |
---|
135 | 142 | union { |
---|
136 | 143 | struct { |
---|
137 | 144 | struct ctl_table *ctl_table; |
---|
.. | .. |
---|
198 | 205 | void unregister_sysctl_table(struct ctl_table_header * table); |
---|
199 | 206 | |
---|
200 | 207 | extern int sysctl_init(void); |
---|
| 208 | +extern void __register_sysctl_init(const char *path, struct ctl_table *table, |
---|
| 209 | + const char *table_name); |
---|
| 210 | +#define register_sysctl_init(path, table) __register_sysctl_init(path, table, #table) |
---|
| 211 | +void do_sysctl_args(void); |
---|
| 212 | + |
---|
| 213 | +extern int pwrsw_enabled; |
---|
| 214 | +extern int unaligned_enabled; |
---|
| 215 | +extern int unaligned_dump_stack; |
---|
| 216 | +extern int no_unaligned_warning; |
---|
201 | 217 | |
---|
202 | 218 | extern struct ctl_table sysctl_mount_point[]; |
---|
| 219 | +extern struct ctl_table random_table[]; |
---|
| 220 | +extern struct ctl_table firmware_config_table[]; |
---|
| 221 | +extern struct ctl_table epoll_table[]; |
---|
203 | 222 | |
---|
204 | 223 | #else /* CONFIG_SYSCTL */ |
---|
205 | 224 | static inline struct ctl_table_header *register_sysctl_table(struct ctl_table * table) |
---|
.. | .. |
---|
228 | 247 | { |
---|
229 | 248 | } |
---|
230 | 249 | |
---|
| 250 | +static inline void do_sysctl_args(void) |
---|
| 251 | +{ |
---|
| 252 | +} |
---|
231 | 253 | #endif /* CONFIG_SYSCTL */ |
---|
232 | 254 | |
---|
233 | | -int sysctl_max_threads(struct ctl_table *table, int write, |
---|
234 | | - void __user *buffer, size_t *lenp, loff_t *ppos); |
---|
| 255 | +int sysctl_max_threads(struct ctl_table *table, int write, void *buffer, |
---|
| 256 | + size_t *lenp, loff_t *ppos); |
---|
235 | 257 | |
---|
236 | 258 | #endif /* _LINUX_SYSCTL_H */ |
---|