--- linux-2.6.24.noarch.orig/include/linux/time.h +++ linux-2.6.24.noarch/include/linux/time.h @@ -169,7 +169,7 @@ extern struct timeval ns_to_timeval(cons * @a: pointer to timespec to be incremented * @ns: unsigned nanoseconds value to be added */ -static inline void timespec_add_ns(struct timespec *a, u64 ns) +static inline void timespec_add_ns(struct timespec *a, volatile u64 ns) { ns += a->tv_nsec; while(unlikely(ns >= NSEC_PER_SEC)) { --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h @@ -62,6 +62,15 @@ struct kparam_array void *elem; }; +/* On some platforms relocations to global data cannot go into read-only + sections, so 'const' makes no sense and even causes compile failures + with some compilers. */ +#if defined(CONFIG_ALPHA) || defined(CONFIG_IA64) || defined(CONFIG_PPC64) +#define __moduleparam_const +#else +#define __moduleparam_const const +#endif + /* This is the fundamental function for registering boot/module parameters. perm sets the visibility in sysfs: 000 means it's not there, read bits mean it's readable, write bits mean it's @@ -71,7 +80,7 @@ struct kparam_array static int __param_perm_check_##name __attribute__((unused)) = \ BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)); \ static const char __param_str_##name[] = prefix #name; \ - static struct kernel_param const __param_##name \ + static struct kernel_param __moduleparam_const __param_##name \ __attribute_used__ \ __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \ = { __param_str_##name, perm, set, get, { arg } } --- linux-2.6.24.noarch.orig/include/linux/module.h +++ linux-2.6.24.noarch/include/linux/module.h @@ -30,6 +30,15 @@ #define MODULE_NAME_LEN (64 - sizeof(unsigned long)) +/* On some platforms relocations to global data cannot go into read-only + sections, so 'const' makes no sense and even causes compile failures + with some compilers. */ +#if defined(CONFIG_ALPHA) || defined(CONFIG_IA64) || defined(CONFIG_PPC64) +#define __ksym_const +#else +#define __ksym_const const +#endif + struct kernel_symbol { unsigned long value; @@ -192,7 +201,7 @@ void *__symbol_get_gpl(const char *symbo static const char __kstrtab_##sym[] \ __attribute__((section("__ksymtab_strings"))) \ = MODULE_SYMBOL_PREFIX #sym; \ - static const struct kernel_symbol __ksymtab_##sym \ + static __ksym_const struct kernel_symbol __ksymtab_##sym \ __attribute_used__ \ __attribute__((section("__ksymtab" sec), unused)) \ = { (unsigned long)&sym, __kstrtab_##sym }