uclinux-2008R1-RC8(bf561)到VDSP5的移植(7):_sdata
来源:互联网 发布:布局 知乎 编辑:程序博客网 时间:2024/05/18 01:33
在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中包含头文件时可能造成的问题。
- uclinux-2008R1-RC8(bf561)到VDSP5的移植(7):_sdata
- uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(18):_sdata
- uclinux-2008R1-RC8(bf561)到VDSP5的移植(13):未命名union的问题
- uclinux-2008R1-RC8(bf561)到VDSP5的移植(1):前言
- uclinux-2008R1-RC8(bf561)到VDSP5的移植(2):代码注释
- uclinux-2008R1-RC8(bf561)到VDSP5的移植(3):Head.s
- uclinux-2008R1-RC8(bf561)到VDSP5的移植(5):CONFIG_BANK_x
- uclinux-2008R1-RC8(bf561)到VDSP5的移植(6):__bss_start
- uclinux-2008R1-RC8(bf561)到VDSP5的移植(8):_stext
- uclinux-2008R1-RC8(bf561)到VDSP5的移植(9):bf53x_relocate_l1_mem
- uclinux-2008R1-RC8(bf561)到VDSP5的移植(10):编译器配置
- uclinux-2008R1-RC8(bf561)到VDSP5的移植(11):cmdline_init
- uclinux-2008R1-RC8(bf561)到VDSP5的移植(12):init_thread_union
- uclinux-2008R1-RC8(bf561)到VDSP5的移植(14):segment
- uclinux-2008R1-RC8(bf561)到VDSP5的移植(15):WARN()
- uclinux-2008R1-RC8(bf561)到VDSP5的移植(38):cache与spinlock
- uclinux-2008R1-RC8(bf561)到VDSP5的移植(39):链接重排
- uclinux-2008R1-RC8(bf561)到VDSP5的移植(40):中断优先级
- select用存储过程返回的表
- 用DELPHI为ASP开发文件上载组件
- 《一个人的奥林匹克》
- !important在ie7.0的hack方法
- 从数据库中随机抽N条记录
- uclinux-2008R1-RC8(bf561)到VDSP5的移植(7):_sdata
- Delphi使用技巧四则
- 用css制作星级评分
- 如何找出消耗cup的进程信息和执行的语句
- 用Delphi 开发数据库程序经验三则
- uclinux-2008R1-RC8(bf561)到VDSP5的移植(8):_stext
- 分享:CSS使用技巧20则
- SQL查询语句精华使用简要
- eclipse 中的工程不能编译的一个原因