gliethttpgliethttp.blog.chinaunix.net
gliethttp
全部博文(2005)
2014年(2)
2013年(2)
2012年(16)
2011年(66)
2010年(368)
2009年(743)
2008年(491)
2007年(317)
linux_zj
程睿
mzh2100
dogsun88
叶绍琛
kowems
gongping
chumojin
高泽然
xy7777
os123456
hiderhao
zahassio
byy6by
zxy11861
COVID_19
a1960048
swzswz
分类: LINUX
2007-08-02 08:14:50
浅析armlinux-setup_arch()->setup_machine(machine_arch_type)函数2文章来源:http://gliethttp.cublog.cn建议首先参考《浅析armlinux2_4_19启动程序[head-armv.s文件]》[http://gliethttp.cublog.cn]//1.arch/arm/kernel/Setup.c->setup_machine()//include/asm-arm/Mach-types.h->#define machine_arch_type __machine_arch_type//setup_machine(machine_arch_type)//而__machine_arch_type在head-armv.s被赋值//__machine_arch_type=r1=由bootloader直接传入[u-boot1.1.5]=251static struct machine_desc * __init setup_machine(unsigned int nr){extern struct machine_desc __arch_info_begin, __arch_info_end; struct machine_desc *list;//++++++++++++++//processor_id=0x41129200;赋值于arch/arm/kernel/head-armv.s文件[gliethttp]//__proc_info_begin和__proc_info_end在编译链接脚本arch/arm/vmlinux-armv.lds.in中定义//...//__arch_info_begin = .;//*(.arch.info)//__arch_info_end = .;//...//--------------//++++++++++++++//arch/arm/mach-at91rm9200/Core.c//位于.arch.info段//MACHINE_START(AT91RM9200, "ATMEL AT91RM9200")//.nr = MACH_TYPE_##_type=MACH_TYPE_AT91RM9200=251//与上面从u-boot传到r1中的一样[gliethttp]//MAINTAINER("SAN People / ATMEL")//BOOT_MEM(AT91_SDRAM_BASE, AT91C_BASE_SYS, AT91C_VA_BASE_SYS)//BOOT_PARAMS(AT91_SDRAM_BASE + 0x100)//tag list存放的物理地址0x20000100[gliethttp]//FIXUP(at91rm9200_fixup)//MAPIO(at91rm9200_map_io)//INITIRQ(at91rm9200_init_irq)//MACHINE_END[gliethttp]//-------------- for (list = &__arch_info_begin; list < &__arch_info_end; list++) if (list->nr == nr)//匹配没问题 break;//没有匹配上,打印提示,halt系统 if (list >= &__arch_info_end) { printk("Architecture configuration botched (nr %d), unable " "to continue.\n", nr); while (1); } printk("Machine: %s\n", list->name); return list;//返回匹配的machine_desc结构指针}
上一篇:浅析armlinux-setup_arch()->setup_processor()函数1
下一篇:浅析armlinux-setup_arch()->convert_to_tag_list()函数3
登录 注册