| .. | .. |
|---|
| 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_ZERO ((void *)&sysctl_vals[0]) |
|---|
| 42 | +#define SYSCTL_ONE ((void *)&sysctl_vals[1]) |
|---|
| 43 | +#define SYSCTL_INT_MAX ((void *)&sysctl_vals[2]) |
|---|
| 42 | 44 | |
|---|
| 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 *); |
|---|
| 45 | +extern const int sysctl_vals[]; |
|---|
| 46 | + |
|---|
| 47 | +typedef int proc_handler(struct ctl_table *ctl, int write, void *buffer, |
|---|
| 48 | + size_t *lenp, loff_t *ppos); |
|---|
| 49 | + |
|---|
| 50 | +int proc_dostring(struct ctl_table *, int, void *, size_t *, loff_t *); |
|---|
| 51 | +int proc_dointvec(struct ctl_table *, int, void *, size_t *, loff_t *); |
|---|
| 52 | +int proc_douintvec(struct ctl_table *, int, void *, size_t *, loff_t *); |
|---|
| 53 | +int proc_dointvec_minmax(struct ctl_table *, int, void *, size_t *, loff_t *); |
|---|
| 54 | +int proc_douintvec_minmax(struct ctl_table *table, int write, void *buffer, |
|---|
| 55 | + size_t *lenp, loff_t *ppos); |
|---|
| 56 | +int proc_dointvec_jiffies(struct ctl_table *, int, void *, size_t *, loff_t *); |
|---|
| 57 | +int proc_dointvec_userhz_jiffies(struct ctl_table *, int, void *, size_t *, |
|---|
| 58 | + loff_t *); |
|---|
| 59 | +int proc_dointvec_ms_jiffies(struct ctl_table *, int, void *, size_t *, |
|---|
| 60 | + loff_t *); |
|---|
| 61 | +int proc_doulongvec_minmax(struct ctl_table *, int, void *, size_t *, loff_t *); |
|---|
| 62 | +int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, void *, |
|---|
| 63 | + size_t *, loff_t *); |
|---|
| 64 | +int proc_do_large_bitmap(struct ctl_table *, int, void *, size_t *, loff_t *); |
|---|
| 65 | +int proc_do_static_key(struct ctl_table *table, int write, void *buffer, |
|---|
| 66 | + size_t *lenp, loff_t *ppos); |
|---|
| 66 | 67 | |
|---|
| 67 | 68 | /* |
|---|
| 68 | 69 | * Register a set of sysctl names by calling register_sysctl_table |
|---|
| .. | .. |
|---|
| 73 | 74 | * sysctl names can be mirrored automatically under /proc/sys. The |
|---|
| 74 | 75 | * procname supplied controls /proc naming. |
|---|
| 75 | 76 | * |
|---|
| 76 | | - * The table's mode will be honoured both for sys_sysctl(2) and |
|---|
| 77 | | - * proc-fs access. |
|---|
| 77 | + * The table's mode will be honoured for proc-fs access. |
|---|
| 78 | 78 | * |
|---|
| 79 | 79 | * Leaf nodes in the sysctl tree will be represented by a single file |
|---|
| 80 | 80 | * under /proc; non-leaf nodes will be represented by directories. A |
|---|
| 81 | 81 | * null procname disables /proc mirroring at this node. |
|---|
| 82 | 82 | * |
|---|
| 83 | | - * sysctl(2) can automatically manage read and write requests through |
|---|
| 84 | | - * the sysctl table. The data and maxlen fields of the ctl_table |
|---|
| 83 | + * The data and maxlen fields of the ctl_table |
|---|
| 85 | 84 | * struct enable minimal validation of the values being written to be |
|---|
| 86 | 85 | * performed, and the mode field allows minimal authentication. |
|---|
| 87 | 86 | * |
|---|
| .. | .. |
|---|
| 110 | 109 | struct ctl_table_poll name = __CTL_TABLE_POLL_INITIALIZER(name) |
|---|
| 111 | 110 | |
|---|
| 112 | 111 | /* A sysctl table is an array of struct ctl_table: */ |
|---|
| 113 | | -struct ctl_table |
|---|
| 114 | | -{ |
|---|
| 112 | +struct ctl_table { |
|---|
| 115 | 113 | const char *procname; /* Text ID for /proc/sys, or zero */ |
|---|
| 116 | 114 | void *data; |
|---|
| 117 | 115 | int maxlen; |
|---|
| .. | .. |
|---|
| 130 | 128 | |
|---|
| 131 | 129 | /* struct ctl_table_header is used to maintain dynamic lists of |
|---|
| 132 | 130 | struct ctl_table trees. */ |
|---|
| 133 | | -struct ctl_table_header |
|---|
| 134 | | -{ |
|---|
| 131 | +struct ctl_table_header { |
|---|
| 135 | 132 | union { |
|---|
| 136 | 133 | struct { |
|---|
| 137 | 134 | struct ctl_table *ctl_table; |
|---|
| .. | .. |
|---|
| 198 | 195 | void unregister_sysctl_table(struct ctl_table_header * table); |
|---|
| 199 | 196 | |
|---|
| 200 | 197 | extern int sysctl_init(void); |
|---|
| 198 | +void do_sysctl_args(void); |
|---|
| 199 | + |
|---|
| 200 | +extern int pwrsw_enabled; |
|---|
| 201 | +extern int unaligned_enabled; |
|---|
| 202 | +extern int unaligned_dump_stack; |
|---|
| 203 | +extern int no_unaligned_warning; |
|---|
| 201 | 204 | |
|---|
| 202 | 205 | extern struct ctl_table sysctl_mount_point[]; |
|---|
| 206 | +extern struct ctl_table random_table[]; |
|---|
| 207 | +extern struct ctl_table firmware_config_table[]; |
|---|
| 208 | +extern struct ctl_table epoll_table[]; |
|---|
| 203 | 209 | |
|---|
| 204 | 210 | #else /* CONFIG_SYSCTL */ |
|---|
| 205 | 211 | static inline struct ctl_table_header *register_sysctl_table(struct ctl_table * table) |
|---|
| .. | .. |
|---|
| 228 | 234 | { |
|---|
| 229 | 235 | } |
|---|
| 230 | 236 | |
|---|
| 237 | +static inline void do_sysctl_args(void) |
|---|
| 238 | +{ |
|---|
| 239 | +} |
|---|
| 231 | 240 | #endif /* CONFIG_SYSCTL */ |
|---|
| 232 | 241 | |
|---|
| 233 | | -int sysctl_max_threads(struct ctl_table *table, int write, |
|---|
| 234 | | - void __user *buffer, size_t *lenp, loff_t *ppos); |
|---|
| 242 | +int sysctl_max_threads(struct ctl_table *table, int write, void *buffer, |
|---|
| 243 | + size_t *lenp, loff_t *ppos); |
|---|
| 235 | 244 | |
|---|
| 236 | 245 | #endif /* _LINUX_SYSCTL_H */ |
|---|