Module init for compiled in vs loaded modules
Quoted 26 lines
linux/init.h:#ifndef MODULE
...
#definemodule_init(x)__initcall(x);
#define__initcall(fn)device_initcall(fn)#definedevice_initcall(fn)__define_initcall("6",fn)
#define__define_initcall(level,fn)\
staticinitcall_t__initcall_##fn__attribute_used__\ __attribute__((__section__(".initcall" level".init"))) = fn
...
#endifinitcalls are processed in
do_initcallsfunction ininit/main.cstatic void
__initdo_basic_setup(void){ .... do_initcalls(); }Quoted 1 line
Quoted 3 lines
Quoted 1 line
thanks !
Amol
thanks Rajat and Amol.
One other question,
1) how does the kernel know which module to load first in order to satisfy dependencies issues ?
2) is there a way i could print the module init fn name from do_initcalls. to see in what order compiled in modules are called.
tia.
Quoted 26 lines · Fundu
Quoted 26 lines
linux/init.h:#ifndef MODULE
...
#definemodule_init(x)__initcall(x);
#define__initcall(fn)device_initcall(fn)#definedevice_initcall(fn)__define_initcall("6",fn)
#define__define_initcall(level,fn)\
staticinitcall_t__initcall_##fn__attribute_used__\ __attribute__((__section__(".initcall" level".init"))) = fn
...
#endifinitcalls are processed in
do_initcallsfunction ininit/main.cstatic void
__initdo_basic_setup(void){ .... do_initcalls(); }Quoted 1 line
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
thanks !
Amol
thanks Rajat and Amol.
One other question,
1) how does the kernel know which module to load first in order to satisfy dependencies issues ?
By looking at the needed symbols (cfr. depmod).
Quoted 1 line
2) is there a way i could print the module init fn name from
do_initcalls. to see in what order compiled in modules are called.
Add `initcall_debug' to the kernel command line (if you would have looked at do_initcalls() and do_one_initcall(), you would have known).
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453 Fax: +32 (0)2 700 8622 E-mail: [email protected] Internet: http://www.sony-europe.com/
A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010