uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(31):NR_CPUS

本文解决在uCLinux-2008R1.5-RC3中配置ADIf561DSP开发板SMP支持时遇到的问题,具体为未定义标识符CONFIG_NR_CPUS错误。通过定义CONFIG_SMP及CONFIG_NR_CPUS来启用多核支持。

快乐虾

http://blog.youkuaiyun.com/lights_joy/

lights@hb165.com

本文适用于

ADI bf561 DSP

优视BF561EVB开发板

uclinux-2008r1.5-rc3(smp patch)

Visual DSP++ 5.0(update 5)

欢迎转载,但请保留作者信息

有一个错误:

"..\..\linux-2.6.x\include\linux/cpumask.h", line 88: cc0020: error:

identifier "CONFIG_NR_CPUS" is undefined

typedef struct { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t;

NR_CPUS的定义在linux-2.6.x/include/linux/threads.h中:

/*

* Maximum supported processors that can run under SMP. This value is

* set via configure setting. The maximum is equal to the size of the

* bitmasks used on that platform, i.e. 32 or 64. Setting this smaller

* saves quite a bit of memory.

*/

#ifdef CONFIG_SMP

#define NR_CPUS CONFIG_NR_CPUS

#else

#define NR_CPUS 1

#endif

由于希望使用SMP支持,故此定义了CONFIG_SMP,所以NR_CPUS的值就由CONFIG_NR_CPUS决定,查一下这个宏:

查找全部"CONFIG_NR_CPUS", 大小写匹配, 全字匹配, 子文件夹, 查找结果2, "F:\embed\uClinux\uClinux-dist-2008R1.5-RC3\linux-2.6.x;F:\embed\uClinux\uClinux-dist-2008R1.5-RC3\config", "*.*"

F:\embed\uClinux\uClinux-dist-2008R1.5-RC3\linux-2.6.x\.config(140):CONFIG_NR_CPUS=2

F:\embed\uClinux\uClinux-dist-2008R1.5-RC3\linux-2.6.x\.config.old(140):CONFIG_NR_CPUS=2

F:\embed\uClinux\uClinux-dist-2008R1.5-RC3\linux-2.6.x\include\config\auto.conf(81):CONFIG_NR_CPUS=2

F:\embed\uClinux\uClinux-dist-2008R1.5-RC3\linux-2.6.x\include\linux\autoconf.h(82):#define CONFIG_NR_CPUS 2

F:\embed\uClinux\uClinux-dist-2008R1.5-RC3\linux-2.6.x\include\linux\threads.h(17):#define NR_CPUS CONFIG_NR_CPUS

匹配行: 5 匹配文件: 5 合计搜索文件: 13469

uclinux内核将bf561的每一个核都视为一个独立的CPU,因此在config.h中补上定义:

// 多核支持

#define CONFIG_SMP 1

#define CONFIG_NR_CPUS 2

1 参考资料

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(26)abs(2009-1-15)

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(27)CONFIG_RWSEM_GENERIC_SPINLOCK(2009-1-15)

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(28)CONFIG_HZ(2009-1-15)

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(29)cmdline_init(2009-1-15)

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(30)WARN(2009-1-15)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值