aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/module.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/module.h')
-rw-r--r--include/linux/module.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/include/linux/module.h b/include/linux/module.h
index 5e869ffd34aa..515d53ae6a79 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -330,8 +330,11 @@ struct module
330 struct module_notes_attrs *notes_attrs; 330 struct module_notes_attrs *notes_attrs;
331#endif 331#endif
332 332
333#ifdef CONFIG_SMP
333 /* Per-cpu data. */ 334 /* Per-cpu data. */
334 void *percpu; 335 void __percpu *percpu;
336 unsigned int percpu_size;
337#endif
335 338
336 /* The command line arguments (may be mangled). People like 339 /* The command line arguments (may be mangled). People like
337 keeping pointers to this stuff */ 340 keeping pointers to this stuff */
@@ -365,7 +368,8 @@ struct module
365 void (*exit)(void); 368 void (*exit)(void);
366 369
367 struct module_ref { 370 struct module_ref {
368 int count; 371 unsigned int incs;
372 unsigned int decs;
369 } __percpu *refptr; 373 } __percpu *refptr;
370#endif 374#endif
371 375
@@ -392,6 +396,7 @@ static inline int module_is_live(struct module *mod)
392struct module *__module_text_address(unsigned long addr); 396struct module *__module_text_address(unsigned long addr);
393struct module *__module_address(unsigned long addr); 397struct module *__module_address(unsigned long addr);
394bool is_module_address(unsigned long addr); 398bool is_module_address(unsigned long addr);
399bool is_module_percpu_address(unsigned long addr);
395bool is_module_text_address(unsigned long addr); 400bool is_module_text_address(unsigned long addr);
396 401
397static inline int within_module_core(unsigned long addr, struct module *mod) 402static inline int within_module_core(unsigned long addr, struct module *mod)
@@ -459,9 +464,9 @@ static inline void __module_get(struct module *module)
459{ 464{
460 if (module) { 465 if (module) {
461 preempt_disable(); 466 preempt_disable();
462 __this_cpu_inc(module->refptr->count); 467 __this_cpu_inc(module->refptr->incs);
463 trace_module_get(module, _THIS_IP_, 468 trace_module_get(module, _THIS_IP_,
464 __this_cpu_read(module->refptr->count)); 469 __this_cpu_read(module->refptr->incs));
465 preempt_enable(); 470 preempt_enable();
466 } 471 }
467} 472}
@@ -474,11 +479,10 @@ static inline int try_module_get(struct module *module)
474 preempt_disable(); 479 preempt_disable();
475 480
476 if (likely(module_is_live(module))) { 481 if (likely(module_is_live(module))) {
477 __this_cpu_inc(module->refptr->count); 482 __this_cpu_inc(module->refptr->incs);
478 trace_module_get(module, _THIS_IP_, 483 trace_module_get(module, _THIS_IP_,
479 __this_cpu_read(module->refptr->count)); 484 __this_cpu_read(module->refptr->incs));
480 } 485 } else
481 else
482 ret = 0; 486 ret = 0;
483 487
484 preempt_enable(); 488 preempt_enable();
@@ -563,6 +567,11 @@ static inline bool is_module_address(unsigned long addr)
563 return false; 567 return false;
564} 568}
565 569
570static inline bool is_module_percpu_address(unsigned long addr)
571{
572 return false;
573}
574
566static inline bool is_module_text_address(unsigned long addr) 575static inline bool is_module_text_address(unsigned long addr)
567{ 576{
568 return false; 577 return false;