aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/module.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/kernel/module.c b/kernel/module.c
index ba22484a987e..52b3497b8748 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -480,21 +480,6 @@ static void percpu_modfree(void *freeme)
480 } 480 }
481} 481}
482 482
483static unsigned int find_pcpusec(Elf_Ehdr *hdr,
484 Elf_Shdr *sechdrs,
485 const char *secstrings)
486{
487 return find_sec(hdr, sechdrs, secstrings, ".data.percpu");
488}
489
490static void percpu_modcopy(void *pcpudest, const void *from, unsigned long size)
491{
492 int cpu;
493
494 for_each_possible_cpu(cpu)
495 memcpy(pcpudest + per_cpu_offset(cpu), from, size);
496}
497
498static int percpu_modinit(void) 483static int percpu_modinit(void)
499{ 484{
500 pcpu_num_used = 2; 485 pcpu_num_used = 2;
@@ -513,7 +498,24 @@ static int percpu_modinit(void)
513 return 0; 498 return 0;
514} 499}
515__initcall(percpu_modinit); 500__initcall(percpu_modinit);
501
502static unsigned int find_pcpusec(Elf_Ehdr *hdr,
503 Elf_Shdr *sechdrs,
504 const char *secstrings)
505{
506 return find_sec(hdr, sechdrs, secstrings, ".data.percpu");
507}
508
509static void percpu_modcopy(void *pcpudest, const void *from, unsigned long size)
510{
511 int cpu;
512
513 for_each_possible_cpu(cpu)
514 memcpy(pcpudest + per_cpu_offset(cpu), from, size);
515}
516
516#else /* ... !CONFIG_SMP */ 517#else /* ... !CONFIG_SMP */
518
517static inline void *percpu_modalloc(unsigned long size, unsigned long align, 519static inline void *percpu_modalloc(unsigned long size, unsigned long align,
518 const char *name) 520 const char *name)
519{ 521{
@@ -535,6 +537,7 @@ static inline void percpu_modcopy(void *pcpudst, const void *src,
535 /* pcpusec should be 0, and size of that section should be 0. */ 537 /* pcpusec should be 0, and size of that section should be 0. */
536 BUG_ON(size != 0); 538 BUG_ON(size != 0);
537} 539}
540
538#endif /* CONFIG_SMP */ 541#endif /* CONFIG_SMP */
539 542
540#define MODINFO_ATTR(field) \ 543#define MODINFO_ATTR(field) \