📄 jpeg_mjpeg_heap.c
字号:
/*****************************************************************************
Copyright(c) 2005 Analog Devices, Inc. All Rights Reserved. This software is
proprietary and confidential to Analog Devices, Inc. and its licensors.
******************************************************************************
$RCSfile: jpeg_mjpeg_heap.c,v $
$Revision: 1.5 $
$Date: 2006/11/03 07:12:11 $
Project: BlackfinSDK (JPEG-MJPEG)
Title: heap services
Author(s): dwu
Revised by: bmk
Description:
Function to set up the heaps for jpeg-mjpeg
References:
None
******************************************************************************
Tab Setting: 4
Target Processor: ADSP-BF5xx
Target Tools Revision: ADSP VisualDSP++ v4.5
******************************************************************************
Modification History:
====================
$Log: jpeg_mjpeg_heap.c,v $
Revision 1.5 2006/11/03 07:12:11 bmk
SDK 2.0 files - Initial Entry
*****************************************************************************/
#pragma default_section(CODE, "sdram0_bank1")
#include <jpeg_mjpeg_system.h>
static int heapid = 0;
extern int ldf_heap_space;
extern int ldf_heap_length;
extern void ldf_slow_heap_space;
extern size_t ldf_slow_heap_length;
extern void ldf_fast_heap_space;
extern size_t ldf_fast_heap_length;
extern void ldf_stack_space;
extern size_t ldf_stack_length;
/*********************************************************************
Function: setup_heap
Description: function to setup Heap
*********************************************************************/
int setup_heap(void *at, size_t bytes)
{
int index;
if ( (index = heap_install(at,bytes,++heapid)) == -1) {
#ifdef ADI_MMSK_EXTRA_INFO // Extra debug information
printf("Failed to initialize heap with userid %d\n",heapid);
#endif
exit(EXIT_FAILURE);
}
return index;
}
/*********************************************************************
Function: InstallCodecHeaps
Description: Displays extra debug info and calls routine to
setup heap
*********************************************************************/
int InstallCodecHeaps(void)
{
int temp;
#ifdef ADI_MMSK_EXTRA_INFO // Extra debug information
printf("stack is installed in L1 memory");
printf("---> starting at 0x%x, size %d kbytes\n", &ldf_stack_space, (int)&ldf_stack_length/1024 );
printf("installing fast heap in non-cacheable L1 memory");
#endif
temp = setup_heap( &ldf_slow_heap_space, (size_t)&ldf_slow_heap_length);
#ifdef ADI_MMSK_EXTRA_INFO // Extra debug information
printf("---> index 0, starting at 0x%x, size %d kbytes\n", &ldf_heap_space, (int)&ldf_heap_length/1024 );
printf("installing slow heap in cacheable external memory");
printf("---> index %d, starting at 0x%x, size %d kbytes\n", temp, &ldf_slow_heap_space, (int)&ldf_slow_heap_length/1024);
printf("installing fast heap in non-cacheable L1 memory");
#endif
temp = setup_heap( &ldf_fast_heap_space, (size_t)&ldf_fast_heap_length);
#ifdef ADI_MMSK_EXTRA_INFO // Extra debug information
printf("---> index %d, starting at 0x%x, size %d kbytes\n", temp, &ldf_fast_heap_space, (int)&ldf_fast_heap_length/1024);
#endif
return temp;
}
/*****/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -