#define DECLARE_PER_CPU(type, name) \
DECLARE_PER_CPU_SECTION(type, name, "")
#define DEFINE_PER_CPU(type, name) \
DEFINE_PER_CPU_SECTION(type, name, "")
看看具体定义:
/*
* Normal declaration and definition macros.
*/
#define DECLARE_PER_CPU_SECTION(type, name, sec) \
extern __PCPU_ATTRS(sec) __typeof__(type) name
#define DEFINE_PER_CPU_SECTION(type, name, sec) \
__PCPU_ATTRS(sec) PER_CPU_DEF_ATTRIBUTES \
__typeof__(type) name
#endif
注意到extern了吧
DECLARE_PER_CPU_SECTION 只是extern DEFINE_PER_CPU定义的per cpu变量
DECLARE_PER_CPU_SECTION 只是声名, 不是定义。
现在真的理解 英语中 define , declare 了。