MACHINE_START(OMAP4_PANDA, "OMAP4430 Panda Board")
.phys_io = 0x48000000,
.io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
.boot_params = 0x80000100,
.map_io = omap_panda_map_io,
.init_irq = omap_panda_init_irq,
.init_machine = omap_panda_init,
.timer = &omap_timer,
MACHINE_END
我没有得到这个......?这是一个宏观或结构或什么.. ???
定义说
/*
* Set of macros to define architecture features. This is built into
* a table by the linker.
*/
#define MACHINE_START(_type,_name) \
static const struct machine_desc __mach_desc_##_type \
__used \
__attribute__((__section__(".arch.info.init"))) = { \
.nr = MACH_TYPE_##_type, \
.name = _name,
#define MACHINE_END \
};
#endif
但我不明白它是如何运作的?
答案 0 :(得分:4)
designated structure initialization是一个GNU GCC扩展,如果您习惯于ANSI C编译器,它看起来有点奇怪。结合雄心勃勃的宏观,使其在许多方面看起来像一门外语。扩展的源代码是:
static const struct machine_desc __mach_desc_OMAP4_PANDA
__used __attribute__((__section__(".arch.info.init"))) = {
.nr = MACH_TYPE_OMAP4_PANDA,
.name = "OMAP4430 Panda Board",
.phys_io = 0x48000000,
.io_pg_offst = ((0xfa000000) >> 18) & 0xfffc,
.boot_params = 0x80000100,
.map_io = omap_panda_map_io,
.init_irq = omap_panda_init_irq,
.init_machine = omap_panda_init,
.timer = &omap_timer,
};
答案 1 :(得分:2)
<强> MACHINE_START 强>
在以下位置定义为预处理器宏: arch/arm/include/asm/mach/arch.h, line 67
<强> MACHINE_END 强>
在以下位置定义为预处理器宏: arch/arm/include/asm/mach/arch.h, line 74
我将此站点用于Linux内核引用 http://lxr.free-electrons.com/
答案 2 :(得分:0)
这是一个初始化结构对象的指定初始值设定项。