hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/include/linux/sysctl.h
....@@ -37,32 +37,33 @@
3737 struct ctl_table_header;
3838 struct ctl_dir;
3939
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])
4244
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);
6667
6768 /*
6869 * Register a set of sysctl names by calling register_sysctl_table
....@@ -73,15 +74,13 @@
7374 * sysctl names can be mirrored automatically under /proc/sys. The
7475 * procname supplied controls /proc naming.
7576 *
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.
7878 *
7979 * Leaf nodes in the sysctl tree will be represented by a single file
8080 * under /proc; non-leaf nodes will be represented by directories. A
8181 * null procname disables /proc mirroring at this node.
8282 *
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
8584 * struct enable minimal validation of the values being written to be
8685 * performed, and the mode field allows minimal authentication.
8786 *
....@@ -110,8 +109,7 @@
110109 struct ctl_table_poll name = __CTL_TABLE_POLL_INITIALIZER(name)
111110
112111 /* A sysctl table is an array of struct ctl_table: */
113
-struct ctl_table
114
-{
112
+struct ctl_table {
115113 const char *procname; /* Text ID for /proc/sys, or zero */
116114 void *data;
117115 int maxlen;
....@@ -130,8 +128,7 @@
130128
131129 /* struct ctl_table_header is used to maintain dynamic lists of
132130 struct ctl_table trees. */
133
-struct ctl_table_header
134
-{
131
+struct ctl_table_header {
135132 union {
136133 struct {
137134 struct ctl_table *ctl_table;
....@@ -198,8 +195,17 @@
198195 void unregister_sysctl_table(struct ctl_table_header * table);
199196
200197 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;
201204
202205 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[];
203209
204210 #else /* CONFIG_SYSCTL */
205211 static inline struct ctl_table_header *register_sysctl_table(struct ctl_table * table)
....@@ -228,9 +234,12 @@
228234 {
229235 }
230236
237
+static inline void do_sysctl_args(void)
238
+{
239
+}
231240 #endif /* CONFIG_SYSCTL */
232241
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);
235244
236245 #endif /* _LINUX_SYSCTL_H */