uclinux-2008R1.5-RC3(bf561)到VDSP5的移植(70):保留VDSP的heap

快乐虾

http://blog.csdn.net/lights_joy/

[email protected]

本文适用于

ADI bf561 DSP

优视BF561EVB开发板

uclinux-2008r1.5-rc3(smp patch)

Visual DSP++ 5.0(update 5)

欢迎转载,但请保留作者信息

本文讨论链接:http://www.bfin-tools.org/bbs/viewthread.php?tid=22&extra=

出于对VDSP运行库的需要,需要为vdsp库保留一段空间做为heap

Vdsp库留了两个符号供用户进行heap的大小,在默认生成的uclinux_heaptab.c中,它是这样定义的:

extern "asm" int ldf_heap_space;

extern "asm" int ldf_heap_length;

struct heap_table_t

{

void *base;

unsigned long length;

long int userid;

};

#pragma file_attr("libData=HeapTable")

#pragma section("constdata")

struct heap_table_t heap_table[2] =

{

{ &ldf_heap_space, (int) &ldf_heap_length, 0 },

{ 0, 0, 0 }

};

ldf_heap_spaceldf_heap_length的定义则是在ldf文件中完成的,默认先从L1分配,如果空间不够再从SDRAM分配。

L1_data_b_stack_heap

{

INPUT_SECTION_ALIGN(4)

RESERVE_EXPAND(heaps_and_stack_in_L1_data_b, heaps_and_stack_in_L1_data_b_length, 0, 4)

ldf_stack_space = heaps_and_stack_in_L1_data_b;

ldf_stack_end = (ldf_stack_space + (((heaps_and_stack_in_L1_data_b_length * 2K) / 2K) - 4)) & 0xfffffffc;

} > MEM_B_L1_DATA_B

我们必须将之限制在一块指定的区域之内,那就简单得多了,在ldf中添加这样一个段:

L1_data_a_stack_heap

{

INPUT_SECTION_ALIGN(4)

ldf_heap_space = .;

ldf_heap_end = MEM_VDSP_HEAP_END;

ldf_heap_length = ldf_heap_end - ldf_heap_space;

} > MEM_VDSP_HEAP

直接给它一个固定值。

1 参考资料

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(66)_ebss_l1(2009-02-13)

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(67)li1240(2009-2-14)

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(68)PLL配置(2009-02-16)

uclinux-2008R1.5-RC3(bf561)VDSP5的移植(69)SHARED_MEMORY(2009-02-17)

你可能感兴趣的:(.net,PHP,Blog,bbs)