快乐虾http://blog.csdn.net/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 undefinedtypedef 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_CPUSCONFIG_NR_CPUS#else#define NR_CPUS1#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=2F:/embed/uClinux/uClinux-dist-2008R1.5-RC3/linux-2.6.x/.config.old(140):CONFIG_NR_CPUS=2F:/embed/uClinux/uClinux-dist-2008R1.5-RC3/linux-2.6.x/include/config/auto.conf(81):CONFIG_NR_CPUS=2F:/embed/uClinux/uClinux-dist-2008R1.5-RC3/linux-2.6.x/include/linux/autoconf.h(82):#define CONFIG_NR_CPUS 2F:/embed/uClinux/uClinux-dist-2008R1.5-RC3/linux-2.6.x/include/linux/threads.h(17):#define NR_CPUSCONFIG_NR_CPUS匹配行: 5匹配文件: 5合计搜索文件: 13469uclinux内核将bf561的每一个核都视为一个独立的CPU,因此在config.h中补上定义:// 多核支持#defineCONFIG_SMP1#defineCONFIG_NR_CPUS2