提交 5ea08178 编写于 作者: M Michal Nazarewicz 提交者: Greg Kroah-Hartman

init.h: add some more documentation to __ref* tags

The __ref* tags may have been confusing for new kernel
developers (I was confused by them for sure) so adding a few
more sentences to comment to clear things up for people who
see those for the first time.
Signed-off-by: NMichal Nazarewicz <m.nazarewicz@samsung.com>
Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: NSam Ravnborg <sam@ravnborg.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 c9bfff9c
...@@ -46,16 +46,23 @@ ...@@ -46,16 +46,23 @@
#define __exitdata __section(.exit.data) #define __exitdata __section(.exit.data)
#define __exit_call __used __section(.exitcall.exit) #define __exit_call __used __section(.exitcall.exit)
/* modpost check for section mismatches during the kernel build. /*
* modpost check for section mismatches during the kernel build.
* A section mismatch happens when there are references from a * A section mismatch happens when there are references from a
* code or data section to an init section (both code or data). * code or data section to an init section (both code or data).
* The init sections are (for most archs) discarded by the kernel * The init sections are (for most archs) discarded by the kernel
* when early init has completed so all such references are potential bugs. * when early init has completed so all such references are potential bugs.
* For exit sections the same issue exists. * For exit sections the same issue exists.
*
* The following markers are used for the cases where the reference to * The following markers are used for the cases where the reference to
* the *init / *exit section (code or data) is valid and will teach * the *init / *exit section (code or data) is valid and will teach
* modpost not to issue a warning. * modpost not to issue a warning. Intended semantics is that a code or
* The markers follow same syntax rules as __init / __initdata. */ * data tagged __ref* can reference code or data from init section without
* producing a warning (of course, no warning does not mean code is
* correct, so optimally document why the __ref is needed and why it's OK).
*
* The markers follow same syntax rules as __init / __initdata.
*/
#define __ref __section(.ref.text) noinline #define __ref __section(.ref.text) noinline
#define __refdata __section(.ref.data) #define __refdata __section(.ref.data)
#define __refconst __section(.ref.rodata) #define __refconst __section(.ref.rodata)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册