现在的位置: 首页 > 综合 > 正文

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

2013年09月02日 ⁄ 综合 ⁄ 共 1898字 ⁄ 字号 评论关闭

 

快乐虾

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 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)

 

 

 

抱歉!评论已关闭.