Linux Kernel: __initマクロ、__exitマクロの役割(メモリの有効利用) by nao · 公開済み 2019年4月29日 · 更新済み 2020年12月25日 __initマクロ、__exitマクロが使われるケース 一般的に、__initマクロはKernelモジュールの初期化時、__exitマクロはKernelモジュールの終了時に付与します。以下の例では、初期化関数がdebimate_init()、終了関数がdebimate_exit()で、それぞれにマクロを付与しています。 static int __init debimate_init(void) { int result = 0; struct device *debimate_dev = NULL; pr_info(KERN_INFO "START: %s\n", __func__); /* メジャー番号の動的
