init.h

来自「上一次项目的vivi 代码」· C头文件 代码 · 共 61 行

H
61
字号
#ifndef _LINUX_INIT_H#define _LINUX_INIT_H#include <linux/config.h>/* These macros are used to mark some functions or  * initialized data (doesn't apply to uninitialized data) * as `initialization' functions. The kernel can take this * as hint that the function is used only during the initialization * phase and free up used memory resources after * * Usage: * For functions: *  * You should add __init immediately before the function name, like: * * static void __init initme(int x, int y) * { *    extern int z; z = x * y; * } * * If the function has a prototype somewhere, you can also add * __init between closing brace of the prototype and semicolon: * * extern int initialize_foobar_device(int, int, int) __init; * * For initialized data: * You should insert __initdata between the variable name and equal * sign followed by value, e.g.: * * static int init_variable __initdata = 0; * static char linux_logo[] __initdata = { 0x32, 0x36, ... }; * * Don't forget to initialize data not at file scope, i.e. within a function, * as gcc otherwise puts the data into the bss section and not into the init * section. *  * Also note, that this data cannot be "const". */#ifndef __ASSEMBLY__/* * Used for initialization calls.. */extern user_command_t   *__initcmd_start, *__initcmd_end;#define __initcmd(cmd)								\	user_command_t* __initcmd_##cmd __init_cmd = &cmd;#endif /* __ASSEMBLY__ *//* * Mark functions and data as being only used at initialization * or exit time. */#define __init_cmd	__attribute__ ((__section__ (".cmd.init")))#endif /* _LINUX_INIT_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?