hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/include/linux/sysctl.h
....@@ -37,32 +37,43 @@
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_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])
4251
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);
6677
6778 /*
6879 * Register a set of sysctl names by calling register_sysctl_table
....@@ -73,15 +84,13 @@
7384 * sysctl names can be mirrored automatically under /proc/sys. The
7485 * procname supplied controls /proc naming.
7586 *
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.
7888 *
7989 * Leaf nodes in the sysctl tree will be represented by a single file
8090 * under /proc; non-leaf nodes will be represented by directories. A
8191 * null procname disables /proc mirroring at this node.
8292 *
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
8594 * struct enable minimal validation of the values being written to be
8695 * performed, and the mode field allows minimal authentication.
8796 *
....@@ -110,8 +119,7 @@
110119 struct ctl_table_poll name = __CTL_TABLE_POLL_INITIALIZER(name)
111120
112121 /* A sysctl table is an array of struct ctl_table: */
113
-struct ctl_table
114
-{
122
+struct ctl_table {
115123 const char *procname; /* Text ID for /proc/sys, or zero */
116124 void *data;
117125 int maxlen;
....@@ -130,8 +138,7 @@
130138
131139 /* struct ctl_table_header is used to maintain dynamic lists of
132140 struct ctl_table trees. */
133
-struct ctl_table_header
134
-{
141
+struct ctl_table_header {
135142 union {
136143 struct {
137144 struct ctl_table *ctl_table;
....@@ -198,8 +205,20 @@
198205 void unregister_sysctl_table(struct ctl_table_header * table);
199206
200207 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;
201217
202218 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[];
203222
204223 #else /* CONFIG_SYSCTL */
205224 static inline struct ctl_table_header *register_sysctl_table(struct ctl_table * table)
....@@ -228,9 +247,12 @@
228247 {
229248 }
230249
250
+static inline void do_sysctl_args(void)
251
+{
252
+}
231253 #endif /* CONFIG_SYSCTL */
232254
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);
235257
236258 #endif /* _LINUX_SYSCTL_H */