diff options
-rw-r--r-- | include/linux/moduleparam.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 8126e55c5bdc..ec624381c844 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
@@ -62,6 +62,16 @@ struct kparam_array | |||
62 | void *elem; | 62 | void *elem; |
63 | }; | 63 | }; |
64 | 64 | ||
65 | /* On alpha, ia64 and ppc64 relocations to global data cannot go into | ||
66 | read-only sections (which is part of respective UNIX ABI on these | ||
67 | platforms). So 'const' makes no sense and even causes compile failures | ||
68 | with some compilers. */ | ||
69 | #if defined(CONFIG_ALPHA) || defined(CONFIG_IA64) || defined(CONFIG_PPC64) | ||
70 | #define __moduleparam_const | ||
71 | #else | ||
72 | #define __moduleparam_const const | ||
73 | #endif | ||
74 | |||
65 | /* This is the fundamental function for registering boot/module | 75 | /* This is the fundamental function for registering boot/module |
66 | parameters. perm sets the visibility in sysfs: 000 means it's | 76 | parameters. perm sets the visibility in sysfs: 000 means it's |
67 | not there, read bits mean it's readable, write bits mean it's | 77 | not there, read bits mean it's readable, write bits mean it's |
@@ -71,7 +81,7 @@ struct kparam_array | |||
71 | static int __param_perm_check_##name __attribute__((unused)) = \ | 81 | static int __param_perm_check_##name __attribute__((unused)) = \ |
72 | BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)); \ | 82 | BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)); \ |
73 | static const char __param_str_##name[] = prefix #name; \ | 83 | static const char __param_str_##name[] = prefix #name; \ |
74 | static struct kernel_param const __param_##name \ | 84 | static struct kernel_param __moduleparam_const __param_##name \ |
75 | __used \ | 85 | __used \ |
76 | __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \ | 86 | __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \ |
77 | = { __param_str_##name, perm, set, get, { arg } } | 87 | = { __param_str_##name, perm, set, get, { arg } } |