MultipleHeaps
所属分类:DSP编程
开发工具:C/C++
文件大小:14KB
下载次数:7
上传日期:2009-11-12 15:03:52
上 传 者:
Kelvenhuai
说明: Sharc 21364 VDK example_multiple heaps
文件列表:
MultipleHeaps (0, 2009-11-12)
MultipleHeaps\A.cpp (2646, 2006-05-26)
MultipleHeaps\A.h (729, 2006-05-26)
MultipleHeaps\B.cpp (2634, 2006-05-26)
MultipleHeaps\B.h (729, 2006-05-26)
MultipleHeaps\heaptab.asm (3505, 2006-05-26)
MultipleHeaps\MultipleHeaps.dpj (6340, 2006-05-26)
MultipleHeaps\MultipleHeaps.dpj.bak (6340, 2006-05-26)
MultipleHeaps\MultipleHeaps.ldf (16448, 2006-05-26)
MultipleHeaps\MultipleHeaps.pcf (1958, 2009-10-28)
MultipleHeaps\MultipleHeaps.vdk (2383, 2006-05-26)
MultipleHeaps\VDK.cpp (8890, 2009-08-07)
MultipleHeaps\VDK.h (5787, 2009-08-07)
Description:
------------
This example provides a simple case of setting up multiple heaps to be used
in VDK projects.
The project consists of three threads: ThreadA, ThreadB and the Idle thread.
The kernel tab shows that ThreadA and the Idle thread are allocated
in the system_heap. ThreadB will allocate its stack and context on a
new heap called user_heap. The ID of the user_heap heap must be 8 characters
long and be the same as the one specified in heaptab.asm
To construct the heaps these steps have to be followed:
- allocate heap memory areas in the LDF (seg_heap and seg_userheap in this
example)
- Create an assembly file defining the heap table (like heaptab.asm)
- Define in the LDF any symbols referenced in the assembly file.
For each thread the VDK status window will display the address of its stack.
It should be seen that ThreadA's stack is in the region of memory
0xB8000 - 0xB8FFF
(seg_heap area in the LDF)
Similarly, ThreadB's stack should be in the region of memory
0xB9000 - 0xB9FFF
(seg_userheap area in the LDF)
In the example, threadA and threadB yield to each other 10 times.
Files
-------
heaptab.asm defines the heaps available in the system.
vdk-213***.ldf has been modified to have a new memory section for user_heap.
It also defines the symbols ldf_userheap_length and ldf_userheap_space
required by heaptab.asm
The LDF has also added ___lib_userheap_space to the list of symbols to keep in
case section elimination is used as it is not referenced directly. If this was
not done, the heap initialisation would fail and the program would fall into
KernelPanic.
近期下载者:
相关文件:
收藏者: