@@ -128,6 +128,9 @@ struct kparam_array
128
128
129
129
/**
130
130
* module_param_unsafe - same as module_param but taints kernel
131
+ * @name: the variable to alter, and exposed parameter name.
132
+ * @type: the type of the parameter
133
+ * @perm: visibility in sysfs.
131
134
*/
132
135
#define module_param_unsafe (name , type , perm ) \
133
136
module_param_named_unsafe(name, name, type, perm)
@@ -150,6 +153,10 @@ struct kparam_array
150
153
151
154
/**
152
155
* module_param_named_unsafe - same as module_param_named but taints kernel
156
+ * @name: a valid C identifier which is the parameter name.
157
+ * @value: the actual lvalue to alter.
158
+ * @type: the type of the parameter
159
+ * @perm: visibility in sysfs.
153
160
*/
154
161
#define module_param_named_unsafe (name , value , type , perm ) \
155
162
param_check_##type(name, &(value)); \
@@ -160,6 +167,7 @@ struct kparam_array
160
167
* module_param_cb - general callback for a module/cmdline parameter
161
168
* @name: a valid C identifier which is the parameter name.
162
169
* @ops: the set & get operations for this parameter.
170
+ * @arg: args for @ops
163
171
* @perm: visibility in sysfs.
164
172
*
165
173
* The ops can have NULL set or get functions.
@@ -171,36 +179,96 @@ struct kparam_array
171
179
__module_param_call(MODULE_PARAM_PREFIX, name, ops, arg, perm, -1, \
172
180
KERNEL_PARAM_FL_UNSAFE)
173
181
182
+ #define __level_param_cb (name , ops , arg , perm , level ) \
183
+ __module_param_call(MODULE_PARAM_PREFIX, name, ops, arg, perm, level, 0)
174
184
/**
175
- * <level>_param_cb - general callback for a module/cmdline parameter
176
- * to be evaluated before certain initcall level
185
+ * core_param_cb - general callback for a module/cmdline parameter
186
+ * to be evaluated before core initcall level
177
187
* @name: a valid C identifier which is the parameter name.
178
188
* @ops: the set & get operations for this parameter.
189
+ * @arg: args for @ops
179
190
* @perm: visibility in sysfs.
180
191
*
181
192
* The ops can have NULL set or get functions.
182
193
*/
183
- #define __level_param_cb (name , ops , arg , perm , level ) \
184
- __module_param_call(MODULE_PARAM_PREFIX, name, ops, arg, perm, level, 0)
185
-
186
194
#define core_param_cb (name , ops , arg , perm ) \
187
195
__level_param_cb(name, ops, arg, perm, 1)
188
196
197
+ /**
198
+ * postcore_param_cb - general callback for a module/cmdline parameter
199
+ * to be evaluated before postcore initcall level
200
+ * @name: a valid C identifier which is the parameter name.
201
+ * @ops: the set & get operations for this parameter.
202
+ * @arg: args for @ops
203
+ * @perm: visibility in sysfs.
204
+ *
205
+ * The ops can have NULL set or get functions.
206
+ */
189
207
#define postcore_param_cb (name , ops , arg , perm ) \
190
208
__level_param_cb(name, ops, arg, perm, 2)
191
209
210
+ /**
211
+ * arch_param_cb - general callback for a module/cmdline parameter
212
+ * to be evaluated before arch initcall level
213
+ * @name: a valid C identifier which is the parameter name.
214
+ * @ops: the set & get operations for this parameter.
215
+ * @arg: args for @ops
216
+ * @perm: visibility in sysfs.
217
+ *
218
+ * The ops can have NULL set or get functions.
219
+ */
192
220
#define arch_param_cb (name , ops , arg , perm ) \
193
221
__level_param_cb(name, ops, arg, perm, 3)
194
222
223
+ /**
224
+ * subsys_param_cb - general callback for a module/cmdline parameter
225
+ * to be evaluated before subsys initcall level
226
+ * @name: a valid C identifier which is the parameter name.
227
+ * @ops: the set & get operations for this parameter.
228
+ * @arg: args for @ops
229
+ * @perm: visibility in sysfs.
230
+ *
231
+ * The ops can have NULL set or get functions.
232
+ */
195
233
#define subsys_param_cb (name , ops , arg , perm ) \
196
234
__level_param_cb(name, ops, arg, perm, 4)
197
235
236
+ /**
237
+ * fs_param_cb - general callback for a module/cmdline parameter
238
+ * to be evaluated before fs initcall level
239
+ * @name: a valid C identifier which is the parameter name.
240
+ * @ops: the set & get operations for this parameter.
241
+ * @arg: args for @ops
242
+ * @perm: visibility in sysfs.
243
+ *
244
+ * The ops can have NULL set or get functions.
245
+ */
198
246
#define fs_param_cb (name , ops , arg , perm ) \
199
247
__level_param_cb(name, ops, arg, perm, 5)
200
248
249
+ /**
250
+ * device_param_cb - general callback for a module/cmdline parameter
251
+ * to be evaluated before device initcall level
252
+ * @name: a valid C identifier which is the parameter name.
253
+ * @ops: the set & get operations for this parameter.
254
+ * @arg: args for @ops
255
+ * @perm: visibility in sysfs.
256
+ *
257
+ * The ops can have NULL set or get functions.
258
+ */
201
259
#define device_param_cb (name , ops , arg , perm ) \
202
260
__level_param_cb(name, ops, arg, perm, 6)
203
261
262
+ /**
263
+ * late_param_cb - general callback for a module/cmdline parameter
264
+ * to be evaluated before late initcall level
265
+ * @name: a valid C identifier which is the parameter name.
266
+ * @ops: the set & get operations for this parameter.
267
+ * @arg: args for @ops
268
+ * @perm: visibility in sysfs.
269
+ *
270
+ * The ops can have NULL set or get functions.
271
+ */
204
272
#define late_param_cb (name , ops , arg , perm ) \
205
273
__level_param_cb(name, ops, arg, perm, 7)
206
274
@@ -263,6 +331,10 @@ static inline void kernel_param_unlock(struct module *mod)
263
331
264
332
/**
265
333
* core_param_unsafe - same as core_param but taints kernel
334
+ * @name: the name of the cmdline and sysfs parameter (often the same as var)
335
+ * @var: the variable
336
+ * @type: the type of the parameter
337
+ * @perm: visibility in sysfs
266
338
*/
267
339
#define core_param_unsafe (name , var , type , perm ) \
268
340
param_check_##type(name, &(var)); \
0 commit comments