diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/params.c | 39 |
1 files changed, 13 insertions, 26 deletions
diff --git a/kernel/params.c b/kernel/params.c index 3c4a9f1b095e..3e78fdb445e7 100644 --- a/kernel/params.c +++ b/kernel/params.c | |||
@@ -193,7 +193,9 @@ int parse_args(const char *name, | |||
193 | int param_get_##name(char *buffer, struct kernel_param *kp) \ | 193 | int param_get_##name(char *buffer, struct kernel_param *kp) \ |
194 | { \ | 194 | { \ |
195 | return sprintf(buffer, format, *((type *)kp->arg)); \ | 195 | return sprintf(buffer, format, *((type *)kp->arg)); \ |
196 | } | 196 | } \ |
197 | EXPORT_SYMBOL(param_set_##name); \ | ||
198 | EXPORT_SYMBOL(param_get_##name) | ||
197 | 199 | ||
198 | STANDARD_PARAM_DEF(byte, unsigned char, "%c", unsigned long, strict_strtoul); | 200 | STANDARD_PARAM_DEF(byte, unsigned char, "%c", unsigned long, strict_strtoul); |
199 | STANDARD_PARAM_DEF(short, short, "%hi", long, strict_strtol); | 201 | STANDARD_PARAM_DEF(short, short, "%hi", long, strict_strtol); |
@@ -222,11 +224,13 @@ int param_set_charp(const char *val, struct kernel_param *kp) | |||
222 | 224 | ||
223 | return 0; | 225 | return 0; |
224 | } | 226 | } |
227 | EXPORT_SYMBOL(param_set_charp); | ||
225 | 228 | ||
226 | int param_get_charp(char *buffer, struct kernel_param *kp) | 229 | int param_get_charp(char *buffer, struct kernel_param *kp) |
227 | { | 230 | { |
228 | return sprintf(buffer, "%s", *((char **)kp->arg)); | 231 | return sprintf(buffer, "%s", *((char **)kp->arg)); |
229 | } | 232 | } |
233 | EXPORT_SYMBOL(param_get_charp); | ||
230 | 234 | ||
231 | /* Actually could be a bool or an int, for historical reasons. */ | 235 | /* Actually could be a bool or an int, for historical reasons. */ |
232 | int param_set_bool(const char *val, struct kernel_param *kp) | 236 | int param_set_bool(const char *val, struct kernel_param *kp) |
@@ -254,6 +258,7 @@ int param_set_bool(const char *val, struct kernel_param *kp) | |||
254 | *(int *)kp->arg = v; | 258 | *(int *)kp->arg = v; |
255 | return 0; | 259 | return 0; |
256 | } | 260 | } |
261 | EXPORT_SYMBOL(param_set_bool); | ||
257 | 262 | ||
258 | int param_get_bool(char *buffer, struct kernel_param *kp) | 263 | int param_get_bool(char *buffer, struct kernel_param *kp) |
259 | { | 264 | { |
@@ -266,6 +271,7 @@ int param_get_bool(char *buffer, struct kernel_param *kp) | |||
266 | /* Y and N chosen as being relatively non-coder friendly */ | 271 | /* Y and N chosen as being relatively non-coder friendly */ |
267 | return sprintf(buffer, "%c", val ? 'Y' : 'N'); | 272 | return sprintf(buffer, "%c", val ? 'Y' : 'N'); |
268 | } | 273 | } |
274 | EXPORT_SYMBOL(param_get_bool); | ||
269 | 275 | ||
270 | /* This one must be bool. */ | 276 | /* This one must be bool. */ |
271 | int param_set_invbool(const char *val, struct kernel_param *kp) | 277 | int param_set_invbool(const char *val, struct kernel_param *kp) |
@@ -281,11 +287,13 @@ int param_set_invbool(const char *val, struct kernel_param *kp) | |||
281 | *(bool *)kp->arg = !boolval; | 287 | *(bool *)kp->arg = !boolval; |
282 | return ret; | 288 | return ret; |
283 | } | 289 | } |
290 | EXPORT_SYMBOL(param_set_invbool); | ||
284 | 291 | ||
285 | int param_get_invbool(char *buffer, struct kernel_param *kp) | 292 | int param_get_invbool(char *buffer, struct kernel_param *kp) |
286 | { | 293 | { |
287 | return sprintf(buffer, "%c", (*(bool *)kp->arg) ? 'N' : 'Y'); | 294 | return sprintf(buffer, "%c", (*(bool *)kp->arg) ? 'N' : 'Y'); |
288 | } | 295 | } |
296 | EXPORT_SYMBOL(param_get_invbool); | ||
289 | 297 | ||
290 | /* We break the rule and mangle the string. */ | 298 | /* We break the rule and mangle the string. */ |
291 | static int param_array(const char *name, | 299 | static int param_array(const char *name, |
@@ -346,6 +354,7 @@ int param_array_set(const char *val, struct kernel_param *kp) | |||
346 | arr->elemsize, arr->set, kp->flags, | 354 | arr->elemsize, arr->set, kp->flags, |
347 | arr->num ?: &temp_num); | 355 | arr->num ?: &temp_num); |
348 | } | 356 | } |
357 | EXPORT_SYMBOL(param_array_set); | ||
349 | 358 | ||
350 | int param_array_get(char *buffer, struct kernel_param *kp) | 359 | int param_array_get(char *buffer, struct kernel_param *kp) |
351 | { | 360 | { |
@@ -366,6 +375,7 @@ int param_array_get(char *buffer, struct kernel_param *kp) | |||
366 | buffer[off] = '\0'; | 375 | buffer[off] = '\0'; |
367 | return off; | 376 | return off; |
368 | } | 377 | } |
378 | EXPORT_SYMBOL(param_array_get); | ||
369 | 379 | ||
370 | int param_set_copystring(const char *val, struct kernel_param *kp) | 380 | int param_set_copystring(const char *val, struct kernel_param *kp) |
371 | { | 381 | { |
@@ -379,12 +389,14 @@ int param_set_copystring(const char *val, struct kernel_param *kp) | |||
379 | strcpy(kps->string, val); | 389 | strcpy(kps->string, val); |
380 | return 0; | 390 | return 0; |
381 | } | 391 | } |
392 | EXPORT_SYMBOL(param_set_copystring); | ||
382 | 393 | ||
383 | int param_get_string(char *buffer, struct kernel_param *kp) | 394 | int param_get_string(char *buffer, struct kernel_param *kp) |
384 | { | 395 | { |
385 | const struct kparam_string *kps = kp->str; | 396 | const struct kparam_string *kps = kp->str; |
386 | return strlcpy(buffer, kps->string, kps->maxlen); | 397 | return strlcpy(buffer, kps->string, kps->maxlen); |
387 | } | 398 | } |
399 | EXPORT_SYMBOL(param_get_string); | ||
388 | 400 | ||
389 | /* sysfs output in /sys/modules/XYZ/parameters/ */ | 401 | /* sysfs output in /sys/modules/XYZ/parameters/ */ |
390 | #define to_module_attr(n) container_of(n, struct module_attribute, attr) | 402 | #define to_module_attr(n) container_of(n, struct module_attribute, attr) |
@@ -754,28 +766,3 @@ static int __init param_sysfs_init(void) | |||
754 | subsys_initcall(param_sysfs_init); | 766 | subsys_initcall(param_sysfs_init); |
755 | 767 | ||
756 | #endif /* CONFIG_SYSFS */ | 768 | #endif /* CONFIG_SYSFS */ |
757 | |||
758 | EXPORT_SYMBOL(param_set_byte); | ||
759 | EXPORT_SYMBOL(param_get_byte); | ||
760 | EXPORT_SYMBOL(param_set_short); | ||
761 | EXPORT_SYMBOL(param_get_short); | ||
762 | EXPORT_SYMBOL(param_set_ushort); | ||
763 | EXPORT_SYMBOL(param_get_ushort); | ||
764 | EXPORT_SYMBOL(param_set_int); | ||
765 | EXPORT_SYMBOL(param_get_int); | ||
766 | EXPORT_SYMBOL(param_set_uint); | ||
767 | EXPORT_SYMBOL(param_get_uint); | ||
768 | EXPORT_SYMBOL(param_set_long); | ||
769 | EXPORT_SYMBOL(param_get_long); | ||
770 | EXPORT_SYMBOL(param_set_ulong); | ||
771 | EXPORT_SYMBOL(param_get_ulong); | ||
772 | EXPORT_SYMBOL(param_set_charp); | ||
773 | EXPORT_SYMBOL(param_get_charp); | ||
774 | EXPORT_SYMBOL(param_set_bool); | ||
775 | EXPORT_SYMBOL(param_get_bool); | ||
776 | EXPORT_SYMBOL(param_set_invbool); | ||
777 | EXPORT_SYMBOL(param_get_invbool); | ||
778 | EXPORT_SYMBOL(param_array_set); | ||
779 | EXPORT_SYMBOL(param_array_get); | ||
780 | EXPORT_SYMBOL(param_set_copystring); | ||
781 | EXPORT_SYMBOL(param_get_string); | ||