网站公告列表

  没有公告

加入收藏
设为首页
联系本站
您现在的位置: AnalogCN安诺电子 >> 文章 >> 技术交流 >> 文章正文
  uclinux-2008R1-RC8(bf561)到VDSP5的移植(7):_sdata           ★★★ 【字体:
uclinux-2008R1-RC8(bf561)到VDSP5的移植(7):_sdata
作者:快乐虾    文章来源:http://blog.csdn.net/lights_joy    点击数:    更新时间:2008-5-3    
在head.s中,要保存数据段的起始位置,如下所示:
       p1.l = __rambase;
       p1.h = __rambase;
       r0.l = __sdata;
       r0.h = __sdata;
       [p1] = r0;
在这里,_sdata是在vmlinux.lds.s中定义的一个值,它指向数据段的首地址,如下所示:
     .data :
     {
         /* make sure the init_task is aligned to the
          * kernel thread size so we can locate the kernel
          * stack properly and quickly.
          */
         __sdata = .;
         . = ALIGN(THREAD_SIZE);
         *(.data.init_task)
 
         . = ALIGN(32);
         *(.data.cacheline_aligned)
 
         DATA_DATA
         *(.data.*)
         CONSTRUCTORS
 
         . = ALIGN(THREAD_SIZE);
         __edata = .;
     }
在VDSP向导生成的LDF文件中,也需要使用数据段,不过它是把代码和数据混合放在一起的:
      sdram
      {
         INPUT_SECTION_ALIGN(4)
         INPUT_SECTIONS($OBJECTS_CORE_A(sdram_bank0) $LIBRARIES_CORE_A(sdram_bank0))
        
         /*$VDSG<insert-input-sections-at-the-start-of-sdram-A> */
         /* Text inserted between these $VDSG comments will be preserved */
         /*$VDSG<insert-input-sections-at-the-start-of-sdram-A> */
        
         INPUT_SECTIONS($OBJECTS_CORE_A(VDK_ISR_code) $LIBRARIES_CORE_A(VDK_ISR_code))
         INPUT_SECTIONS($OBJECTS_CORE_A(program) $LIBRARIES_CORE_A(program))
         INPUT_SECTIONS($OBJECTS_CORE_A(noncache_code) $LIBRARIES_CORE_A(noncache_code))
         INPUT_SECTIONS($OBJECTS_CORE_A(sdram_data) $LIBRARIES_CORE_A(sdram_data))
         INPUT_SECTIONS($OBJECTS_CORE_A(data1) $LIBRARIES_CORE_A(data1))
         INPUT_SECTIONS($OBJECTS_CORE_A(voldata) $LIBRARIES_CORE_A(voldata))
         INPUT_SECTIONS($OBJECTS_CORE_A(constdata) $LIBRARIES_CORE_A(constdata))
        
        /*$VDSG<insert-input-sections-at-the-end-of-sdram-A>   */
         /* Text inserted between these $VDSG comments will be preserved */
         /*$VDSG<insert-input-sections-at-the-end-of-sdram-A>   */
        
      } > MEM_SDRAM
因此我们需要将之拆开分成两个段:
      sdram
      {
         INPUT_SECTION_ALIGN(4)
         INPUT_SECTIONS($OBJECTS_CORE_A(sdram_bank0) $LIBRARIES_CORE_A(sdram_bank0))
        
         /*$VDSG<insert-input-sections-at-the-start-of-sdram-A> */
         /* Text inserted between these $VDSG comments will be preserved */
         /*$VDSG<insert-input-sections-at-the-start-of-sdram-A> */
        
         INPUT_SECTIONS($OBJECTS_CORE_A(VDK_ISR_code) $LIBRARIES_CORE_A(VDK_ISR_code))
         INPUT_SECTIONS($OBJECTS_CORE_A(program) $LIBRARIES_CORE_A(program))
         INPUT_SECTIONS($OBJECTS_CORE_A(noncache_code) $LIBRARIES_CORE_A(noncache_code))
        
         /*$VDSG<insert-input-sections-at-the-end-of-sdram-A>   */
         /* Text inserted between these $VDSG comments will be preserved */
         /*$VDSG<insert-input-sections-at-the-end-of-sdram-A>   */
        
      } > MEM_SDRAM
 
        .data
        {
              /* make sure the init_task is aligned to the
               * kernel thread size so we can locate the kernel
               * stack properly and quickly.
               */
               __sdata = .;
               INPUT_SECTION_ALIGN(8192)
               INPUT_SECTIONS($LIBRARIES_CORE_A(.data.init_task))
 
               INPUT_SECTION_ALIGN(32)
               INPUT_SECTIONS($LIBRARIES_CORE_A(.data.cacheline_aligned))
 
         INPUT_SECTIONS($OBJECTS_CORE_A(sdram_data) $LIBRARIES_CORE_A(sdram_data))
         INPUT_SECTIONS($OBJECTS_CORE_A(data1) $LIBRARIES_CORE_A(data1))
         INPUT_SECTIONS($OBJECTS_CORE_A(voldata) $LIBRARIES_CORE_A(voldata))
         INPUT_SECTIONS($OBJECTS_CORE_A(constdata) $LIBRARIES_CORE_A(constdata))
               INPUT_SECTIONS($OBJECTS_CORE_A(.data.*))
 
               . = (. + 8191) / 8192 * 8192;
               __edata = .;
        } > MEM_SDRAM
在这里直接将THREAD_SIZE替换为8192,避免在LDF中包含头文件时可能造成的问题。
文章录入:admin    责任编辑:admin 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关文章
    ucos-ii在嵌入式智能视觉监控
    14bit 40 MSamples/s ADC应用
    打造windows下的嵌入式开发工
    DSP和FPGA在汽车电子中的广泛
    [连载]ADSP-TSl01S系列之一 
    ADI ADIS1625x低功耗陀螺仪方
    基于DSP的实时图像跟踪系统的
    wxWidgets和MFC动态类型信息
    用dll方式编译wxWidgets-2.8
    Blackfin时钟控制
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    版权所有:AnalogCN安诺电子 湘ICP备06016315号