DSP

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

2019-07-13 17:14发布

  快乐虾 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)   欢迎转载,但请保留作者信息   在每个核初始化的时候,都将调用一个叫init_pda的函数,用以初始化每个核的私有数据区: asmlinkage void init_pda(void) {      unsigned int cpu = raw_smp_processor_id();        /* Initialize the PDA fields holding references to other parts         of the memory. The content of such memory is still         undefined at the time of the call, we are only setting up         valid pointers to it. */      memset(cpu_pda, 0, sizeof(*cpu_pda)); #ifdef CONFIG_MPU #else      write_pda(ipdt, ipdt_tables[cpu]); #ifdef CONFIG_CPLB_INFO      write_pda(ipdt_swapcount, ipdt_swapcount_tables[cpu]);      write_pda(dpdt_swapcount, dpdt_swapcount_tables[cpu]); #endif      write_pda(dpdt, dpdt_tables[cpu]); #endif      write_pda(ex_stack, exception_stacks[cpu + 1]); #ifdef CONFIG_SMP      write_pda(imask, 0x1f); #endif } 在这里,exception_stacks是一个比较特殊的数组,说它特殊,是因为它的定义放在了linux-2.6.x/arch/blackfin/mach-common/entry.S中,且对移植造成了一定的困扰:   ENTRY(_exception_stacks)      .rept 1024*NR_CPUS      .long 0;      .endr _exception_stack_top:   Vdsp的汇编器是不支持.rept的,因此将这段代码改为: .global _exception_stacks; .byte4 _exception_stacks[1024*NR_CPUS] = {0}; _exception_stack_top: 当然,这样会造成一个警告: [Warning ea1049] "../../linux-2.6.x/arch/blackfin/mach-common/entry.S":1445 Too few initializers specified. Expected 2048 but found 1 for "_exception_stacks". The remaining 2047 elements were initialized to zero. 本来就是要把这些元素置0的,所以略过这个警告。  

1       参考资料

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(38):未命名union的问题(2009-01-16) uclinux-2008R1.5-RC3(bf561)VDSP5的移植(39)CONFIG_BASE_SMALL(2009-1-16) uclinux-2008R1.5-RC3(bf561)VDSP5的移植(40):远调用(2009-1-17) uclinux-2008R1.5-RC3(bf561)VDSP5的移植(41)bfin_write_EVT15(2009-1-17) uclinux-2008R1.5-RC3(bf561)VDSP5的移植(42).macro(2009-1-17)