__setup macro?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello,

Anybody here could please explain to me how __setup macro works?

For example, in drivers/block/loop.c, we have
__setup("max_loop=", max_loop_setup)

After some investigation, I see that __setup is a macro that defines a
static struct obs_kernel_param, as in its definition:

 #define __setup_param(str, unique_id, fn, early)                        \
         static char __setup_str_##unique_id[] __initdata = str; \
         static struct obs_kernel_param __setup_##unique_id      \
                 __attribute_used__                              \
                 __attribute__((__section__(".init.setup")))     \
                 __attribute__((aligned((sizeof(long)))))        \
                 = { __setup_str_##unique_id, fn, early }
 
 #define __setup(str, fn)                                        \
         __setup_param(str, fn, fn, 0)

Things look fine, but the problem is how obs_kernel_param is used? I
guess the function fn (as in the above example, is "max_loop_setup")
will be called somewhere, but I dont see how it is called (?)

All the helps are appreciated.

Thank you,
Hieu

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux